0

I am following this tutorial to make my ADC Pi chip work, http://elinux.org/RPi_ADC_I2C_Python

but when I am running the example code, root@raspberrypi:/home/pi# ./adc_demo.py

I am consistently getting this error

Traceback (most recent call last):
  File "./adc_demo.py", line 54, in <module>
    print("1: %f" % getadcreading(adc_address1, adc_channel1))
  File "./adc_demo.py", line 39, in getadcreading
    bus.transaction(i2c.writing_bytes(address, channel))
  File "/home/pi/quick2wire-python-api/quick2wire/i2c.py", line 78, in transaction
    ioctl(self.fd, I2C_RDWR, ioctl_arg)
IOError: [Errno 5] Input/output error

Could anyone please help me out ?

  • 1
    Make sure the i2c-dev module is loaded (lsmod | grep i2c for a clue). If not, modprobe i2c-dev. – goldilocks Oct 31 '13 at 16:07
  • I think it is already loaded, lsmod | grep i2c gives, i2c_dev 5594 0 , i2c_bcm2708 3947 0, but the error stays – Sufiyan Ghori Oct 31 '13 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.