View Single Post
  #2   Spotlight this post!  
Unread 22-02-2010, 12:48
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Using Interrupts or DMA or timing to control digital I/O switch

I think the simplest solution for you would be to use the DIO pin as the input to a Counter. That way you won't need to rely on reading the state of the pin at the precise moment the sensor is detecting the hole. Just reset the counter before you run the drum, then watch the output of the counter and take appropriate action when it has counted the pulse. You might end up reacting slightly later than you think you should, but that's better than not reacting at all.
Reply With Quote