C code is not working

I have the gopigo running with a raspberry pi2.
I am just testing the C example and this is not working. All the python examples works.

I am printing the error received.

./gopigo
Error writing to GoPiGo: Input/output error
Enter 1 for left led and 0 for right led:
l1
Error writing to GoPiGo: Input/output error

i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – 08 – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

Also all the tests works from python.
Are there any changes to be done for raspberry pi 2 to make this work or any other solution ?

Thanks,
Marian

It looks that only the led’s are not working and getting that input/output error.
Other functions - motor moves and servo are working.

Please advice a solution for led’s to work.

Thanks,
Marian

Hi Marian,
Can you paste the screenshot or log of how you are compiling the C code and the output that you get. Can you also run the troubleshooting script from here:https://www.youtube.com/watch?v=MJu8k-_UQgg and attach the logs here on the forums.

-Karan

Hi Karan,

I have just bought a GoPiGo and I have installed the GoPiGo libraries on Raspian using git.

I have exactly the same behavior with the LEDs, please see the following :

pi@raspberrypi:~/GoPiGo/Software/C $ ./gopigo
Error writing to GoPiGo
Enter cmd: v
Firmware Version: 16
Enter cmd: lo
Enter 1 for left led and 0 for right led:
0
Error writing to GoPiGo

I have to say that the Python code is able to open/close the LEDs, so I guess it must come from the C lib.

Any help would be greatly appreciated,

-Fred

I’ll try out the C code at my end and let you know how it goes.

-Karan