View Single Post
  #5   Spotlight this post!  
Unread 27-11-2015, 08:42
JesseK's Avatar
JesseK JesseK is online now
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,684
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: How to time an action in teleop without delaying teleop.

Quote:
Originally Posted by SamCarlberg View Post
Hey Ben!

Solenoid methods are thread-safe. I'd be more worried about scheduling a close, doing some stuff, then opening the solenoid (and expecting it to stay open) before the scheduled close happens. In this case, the methods for opening/closing the solenoid should have checks to see if it's been claimed by a different call.


But I don't think it's a problem for something this simple.
It can be solved by limiting the exposure of the solenoid to a class that governs the entire mechanism, then by calling TimerTask.cancel() to eliminate the auto-close when the mechanism is told to do something different.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
Reply With Quote