|
Re: quick question: TIMERS
Quote:
|
Originally Posted by 10intheCrunch
My mistake. Sorry to confuse...
Your code seems ok at first glance...why don't you put this statement in your Process_data function:
printf("%d\n", (int)rc_dig_in18);
Check the console printout while your program cable is plugged in. Make sure that it changes properly with the switch on your robot.
Too improve efficiency: use else if statements. For example:
if(ticks < 15)
blah;
else if (ticks < 35)
blah;
That will handle your decisions faster...
Sorry again if I confused you eariler. 
|
i stuck in the printf statement and it shows the switch on and off depending on the position, so i know its not the switch its something i did.
__________________
If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.
Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy Photonics, It's Your Future
|