Hello forumers!
Today I tested out the pneumatics that we are going to use with our wings this season, and it didn’t work/worked weird.
I pumped up the tank, set up the solenoid and all that. When I tried to use my code to turn it on and off, it wouldn’t work for some reason. I decided to troubleshoot it by making a fresh blank code file, and just toggling it to true and it worked perfectly fine. However, putting it in an if pressing loop, it wouldn’t do anything. I tried it in my competition code again, and just put a DigitalOutA.set(true); in my driver control while loop and that didn’t do anything at all.
I can’t send a picture of my setup right now, but does anyone have an idea of what my issue could be?
This sounds like it could be a software problem with your code, but if it’s not, I’ve had similar issues before just caused by a broken solenoid - try testing your solenoid mechanically by pressing the blue button on it, this should manually activate it. If that doesn’t work, replace your solenoid. It could also be a problem with your wire - if the above doesn’t help, try replacing it.
It looks like your code is missing a wait inside the infinite loop in the userControl function. Always make sure to have a wait inside of loops which will never end because otherwise it will mess up the task scheduler and will break stuff. There’s also no point running the loop that fast in the driver control loop because you can only get input from sensors and output to motors/pneumatics every ~20 milliseconds. Here’s a version of that part of your code with the wait added:
while (true) {
LeftWing.set(true);
wait(20, msec);
}
Other then that I don’t see anything which would cause the pneumatics to not work, so if it still doesn’t work make sure it is configured properly in the device manager and there isn’t any physical problem.
One last thing, this isn’t related to the pneumatics not working but I would recommend calibrating the inertial sensor in the preAutonomous function instead of autonomous, because then your auto program can start as soon as it is enabled instead of having to wait for the inertial to calibrate