View Single Post
  #2   Spotlight this post!  
Unread 13-02-2014, 11:53
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: More resolution than 20ms

I created a class earlier in the season which would latch the output state of a solenoid for a specified duration.
After the duration has elapsed, the output is de-energized.

This implementation makes use of the TimerTask class.

It should be pretty easy to modify this class for your own use.

https://gist.github.com/jcorcoran/7b1ffd41391144ea8df1

I've tried to comment the code sufficiently, but if you have any questions feel free to contact me.
__________________
http://team2168.org
Reply With Quote