|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#16
|
|||
|
|||
|
Re: Two limit switches, one button
Quote:
|
|
#17
|
|||
|
|||
|
Re: Two limit switches, one button
Quote:
Thank you, Tim |
|
#18
|
|||
|
|||
|
Re: Two limit switches, one button
So, given "Normally Open" port true on open (and wiring GND to Signal on the DIO through the switch) and a 2.0V ish to 0.8 ish transition holding below 0.8V for more than 20nS, we will see WPI_SwitchGetLimitValueReturn true, and WPI_SwitchGetCount will increment.
When does WPI_SwitchGetLimitValueReturn reset? On a transition from -0.8V to 2.0V longer than 20nS? The counter resets to zero on the call to Begin? And between autonomous and teleop? I keep getting challenged (good questions, mostly) on stuff like this, so the ducks need to line up TIA, Tim |
|
#19
|
|||
|
|||
|
Re: Two limit switches, one button
There have been some good comments posted here that I would recommend reading them - especially the one by cgmv123.
For those who are looking for more of a tutorial of one way of accomplishing this task - currently up while button 1 and not top limit switch else down while button 2 and not bottom limit switch - Please refer to this tutorial that I have made, Click here for tutorial It is under limit switch tutorial, although the state machine tutorial is a similar scenario. |
|
#20
|
||||
|
||||
|
Re: Two limit switches, one button
Thanks so much to everyone who gave their impute! They work like a charm!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|