|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Two limit switches, one button
Quote:
We are scraping for documentation on the new Switch VI's. Are these implemented using the FPGA hardware, so it is sampling quick enough that any mostly full range edge is caught? Does the counter reset on system reset? Can we reset the counter? Any debouncing built in? Inquiring minds, Tim |
|
#2
|
|||
|
|||
|
Re: Two limit switches, one button
The limit switch is a simple wrapper over the DIO functions that were already available. They were added primarily for simulation. In order for a simulated robot to be able to identify how a digital line should toggle when something moves, it is useful to identify the switch, tell the physics engine where it is, how it is wired, etc. This is also true of the potentiometer. It is a simple wrapper over AI.
So the FPGA is doing the low level read and filter of the switch, but it is the RT side that is responsible for modifying a motor or other actuator in response. There is no new way to "tie things together" in the FPGA. Greg McKaskle |
|
#3
|
|||
|
|||
|
Re: Two limit switches, one button
Quote:
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||||
|
|||||
|
Re: Two limit switches, one button
If the hardware is built so that the limit switch is not active when the mechanism is at the end of its travel, then what you describe is possible. I wouldn't suggest designing it that way.
|
|
#6
|
|||
|
|||
|
Re: Two limit switches, one button
Quote:
Thank you, Tim |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
||||
|
||||
|
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 |
|
|