Quote:
Originally Posted by team877
... all the inputs are always at one, and then when you press one of the ir buttons it changes the three that aren't being used to zero.
|
This is what you'll see if you power the IR sensor board with a different battery than the one powering your controller. It'll operate fine just the grounds are not common between the two devices as they would be on the robot where both the RC and the IR sensor would both use the same 12v ground.
Is that what you are doing?
You can just program around the all 1's business by checking the pins and only capturing the IR sensor command when three of them drop to zero.
If you are testing the pins one-by-one be careful to take the first non-1 result you get and save that command. Then don't do anything until they all go to 1 again (or all 0's). Otherwise, you could have the pins start to change back while you are testing them and think several of the cmd signals were sent. There are easier/safer ways to handle this in straight C by plugging into digital input pins 15-18 and capturing all the pins simultaneously via (PORTJ>>4).