Help Programming For Switches

I am programming a bot with a few switches and a motor. It seems fairly simple, but I’m having trouble with the switches part. I am using the orangutan-lib and the appropriate settings for the Orangutan Controller, but the switches seem to be very spontaneous. One run, the 6th I/O port read the signal I would have expected for each of the three “separate” switches, and on the next, it was the 8th port. I have no idea what’s going on there, but I am posting the code to see if anyone can help. Note that header files are the orangutan-lib headers as used. Any suggestions would be greatly appreciated. Thanks,


I was using Port C instead of Port D. This seems to have solved our problem for all but one switch. We are currently testing a different switch in that port to verify that it is not a mechanical issue.

It would be good to look at the schematics next time… One-way conversation seems to have resolved this.