Gopigo.py: LED pin switching on analogRead(7)


#1

My LEDs are acting funny. The LED commands are switching pins based on analogRead(7) > 700. I think that is the same as the “brd_rev”. I’m reading values anywhere from 650 to 750 for analogRead(7).
Question: is the threshold value 700 wrong or do I have some other problem?


#2

Hey,
Thanks a lot for reporting that. We’ll have a look at that and update the code. Meanwhile, you can switch to v1.3 of the firmware here: https://github.com/DexterInd/GoPiGo/tree/master/Firmware/fw_ver_13.

-Karan


#3

This is in the python code running on rpi rather than fw_ver_13 running on the gopigo board :slight_smile:

Which pins are correct [16,17] versus [5,10] for the LEDs?
also could using the wrong set impact the motors?

def led_on(l_id):
vol=analogRead(7)
#GPG16
if vol > 700:
r_led=16
l_led=17
else:
r_led=5
l_led=10


#4

Hey,
In v13, the pins are D5 and D10 and those are the ones that you should use.

-Karan