Hi,
I am trying to hook up some grove sensors and use them from Python. However, I do not know the I2C address of any sensor. The addresses are not written on the sensor boards as usually and wiki is lacking.
At this moment, grove relay is connected to UART port (which is configured to become I2C) and on BBG I2C port a grove light sensor is connected. OS is up to date and there are no other devices connected.
i2cdetect returns nothing.
i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
However, this code works:
[code]import time
import Adafruit_BBIO.GPIO as GPIO
Note: Use P9_22(UART2_RXD) as GPIO.
Connect the Grove Relay to UART Grove port of Beaglebone Green.
RELAY = “P9_22” # GPIO P9_22
GPIO.setup(RELAY, GPIO.OUT)
GPIO.output(RELAY, GPIO.LOW)
time.sleep(4)
GPIO.output(RELAY, GPIO.HIGH)[/code]
How come Python can communicate with relay but the i2cdetect does not see it? Also, the example using grove button on UART port also uses GPIO P9_22 address. Is this port hardcoded to only one device?
Thanks.