Thread: Toggling speed
View Single Post
  #2   Spotlight this post!  
Unread 22-01-2016, 11:40
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Toggling speed

Let me see if I have this correct

You want to set a speed.
If 5 seconds elapses, you want it to stop.
If the joystick is touched, you want it to reset the 5 second counter.

Ok, this uses the milli-second timer.
State 1: Speed Pass Through - When button is pressed, go to State 2 and maintain the speed setting (use a feedback node or shift register).
State 2: Have a 5 second counter in this state. If the counter expires, goto State 1. If the joystick exceeds a certain value, reset the counter.

I think that does what you want.

Milisecond timer counter:
Read the value from the millisecond timer and save it in a feedback node. Compare this to the present value of the millisecond timer. If the difference is greater than or equal to 5000, set the output to true. The reset button saves the current value of the timer to the feedback node.

Timer Embedded should do the trick I think
https://github.com/allancass/836-Lib...umatics/Common
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote