I am trying to read digital input using the spi interface on the raspberry pi. Can someone explain why I am getting this UU? I am following this tutorial. I tried troubleshooting (shown below) based on this SO post with no success. I am using this device
pi@raspberrypi ~/Desktop/py-spidev-master $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- UU UU -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi ~/Desktop/py-spidev-master $ i2cget -y 1 0x48
Error: Read failed
pi@raspberrypi ~/Desktop/py-spidev-master $ lsmod | grep i2c_
i2c_dev 6709 0
i2c_bcm2708 6200 0
pi@raspberrypi ~/Desktop/py-spidev-master $ nano ../PiControl/test.py
pi@raspberrypi ~/Desktop/py-spidev-master $ less ../PiControl/test.py
pi@raspberrypi ~/Desktop/py-spidev-master $ cat ../PiControl/test.py
import spidev
import time
spi = spidev.SpiDev()
spi.open(0,0)
while True:
resp = spi.xfer2([0x00])
print resp[0]
time.sleep(1)
pi@raspberrypi ~/Desktop/py-spidev-master $
Note: when I run the script above I get 0 every one second, despite the fact I have AIN0 connected to 3.3V output
Additional Info:
After updating the software I now have:
pi@raspberrypi ~/Desktop/PiControl $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- UU UU -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --