View Single Post
  #1   Spotlight this post!  
Unread 22-03-2004, 01:31
CharlieWilken CharlieWilken is offline
Registered User
#0634 (Robowolves)
 
Join Date: Jan 2002
Location: Van Nuys, CA
Posts: 46
CharlieWilken is an unknown quantity at this point
counting digital input

How do I count digital input ticks?

Im trying to get our autonomous mode to work before our regional this Thursday. Im using the banner optical switches to count ticks on my wheel that I painted on with reflective paint. We have tank style right and left side steering. I estimate I want to move 43 ticks forwared and turn say right with 4 ticks on one side and 1 tick on the other. I then want to move both sides forward 3 ticks. I figure from read chief delphi I can do this using 3 "states" Forward_long, turn and forward_short. However I dont know much C just enough to cut and paste or substitute.

1, How do I make a counter that keeps track of the number of ticks the digital input gets.
2. Where do I put the code for the timer? Where do I put the code for the states?

thanks in advance!