0

I am using ADS1X15 library to read analog data from ADC-1115 adc conver ter. I was successfully using this library as well as module for atleast 2 years.

Now the Python through the error [Errno 121] Remove I/O Error.

What could be the cause of this error?

def inductive_sensor(): global close_application global indu_stop global peak_volt global valley_volt peak_volt = 0 valley_volt = 10 get_adc = False while True: try: ADS = ADS1x15.ADS1115(1, 0x48) ADS.setGain(ADS.PGA_2_048V) ADS.setDataRate(ADS.DR_ADS111X_860) break except: if close_application: break #print ('Inductive Sensor Running...') while not close_application: time.sleep(0.001) val_0 = ADS.readADC_Differential_0_1() volt = ADS.toVoltage(val_0) if volt > peak_volt : peak_volt = volt if volt < valley_volt : valley_volt = volt if maintenance : update_inductive(np.round(volt,3)) indu_stop = True #print ('Inductive Sensor Stopped...') 

I am getting this Error at the line val_0 = ADS.readADC_Differential_0_1()

When I run my program randomly this error would go. But, after a few minutes the error will be back.

3
  • See Tour to see how this site works and How do I ask a good question? Commented Nov 21, 2024 at 9:32
  • We need to see the complete script. Commented Nov 21, 2024 at 9:33
  • Are you saying that absolutely nothing changed, and working code stopped working? Commented Nov 21, 2024 at 15:37

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.