|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Case Structure
This is going into Teleop. I didn't use a Select block because I only want it to go Reverse when I push it. Would this accomplish what I want? Or am I breaking my robot?
|
|
#2
|
||||||
|
||||||
|
Re: Case Structure
The way you have it now, it will always go in reverse, no matter whenther the button is pressed or not.
|
|
#3
|
|||
|
|||
|
Re: Case Structure
What do I need to do to change that?
|
|
#4
|
|||||
|
|||||
|
Re: Case Structure
Change one of the cases (True or False) from "Reverse" to "Forward"
Right now both cases set the solenoid to Reverse. BTW, a Select block can do the same thing. |
|
#5
|
|||
|
|||
|
Re: Case Structure
But won't it go back to forward after I let go of the button?
|
|
#6
|
|||||
|
|||||
|
Re: Case Structure
That's what your code does now.
It will revert when you let go of the button. The Select is just a special 2-case Case. There are easy ways to make the button toggle for either approach. |
|
#7
|
|||
|
|||
|
Re: Case Structure
Quote:
https://www.google.com/url?q=https%3...-XtvmfI_oiGQqA Would that work? And I can code into periodic tasks a solenoid position switch without breaking the togglability right? |
|
#8
|
|||||
|
|||||
|
Re: Case Structure
That Toggle example would work fine, and it'll work in Periodic Tasks.
|
|
#9
|
|||
|
|||
|
Re: Case Structure
So if i have code in Periodic that resets the position to forward, the toggle will still work right?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|