Well now I’m working on doing something for our blinkin led driver I want to use a few different buttons to toggle the lights to different patterns and was trying something like this but having it not work. Is there a better way or is it possible to fix it?
The bottom line is that it should NOT be in an if statement driven by getrawButton, but called as a method of the button. Usually, it is called once during autonomous or teleop init.
I found much more reliability having a variable 1 that i would just negate each time swapping it from 1 to -1 and so on. Then just on press toggle that and run the correct command from there.
any tips on how to do that? I’m still learning code as I work on this project so any help is appreciated (sorry if I’m being difficult or asking stupid questions too)
If yes, then the right answer is to try and have one command running that’s looking for this variable to change or to create a standard java class that could instead send a data point to the runner class that’s doing the heavy lifting.
I’m trying to do that (I originally thought it was part of the joystick import) I tried this: import edu.wpi.first.wpilibj.JoystickButton; but that didn’t work what is that class?
I can upload the code I have so far to github I don’t have seperated classes yet so I’ll warn you there just been putting the code all in one since it is isn’t to many parts
yeah thats our current project with our FRC stuff we are doing vex now which isn’t as fun. We’re using an arm system to launch the shirts. Our FRC programmer graduated last year so nobody learned the code being one of the head members and next years president I got the fun job of the code