Thread: GeneratePWMS
View Single Post
  #8   Spotlight this post!  
Unread 24-02-2004, 00:56
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: GeneratePWMS

Quote:
Originally Posted by Neal Turett
Thanks guys. I found a way to do it. Took some experimenting, but here it is:

Run the sensor output into digital inputs 2 and 3. Have interupt on 2 for the rising edge and one for the falling edge. The first starts the timer, the second reads it out and scales it.

I haven't actually tried this - I'll probably fool with it post-build season, but I was just thinking ahead since my team doesn't let me touch the bot. Something about building it....
You don't have to do it like that. Dig I/O pins 3-6 are interrupt on change, so just plug it into dig io pin 3 and when RBIF triggers check to see that it is indeed pin 3 that changed (since 3-6 all trigger the same flag). You can sense both rising and falling edges on the same pin.