I have been trying to program our pneumatics to open when one button is being pressed, and close when another one is being pressed. It is not working though. This is my team’s first time using pneumatics, so I am not even sure of any potential problems. Could anyone take a look at my code and see if you see anything? Thanks!!!
The robot does not do anything. A memory error comes up on the screen but I’m not sure if this impacts anything. The robot’s lack of response also leads me to believe it could be mechanical.
That sounds like a thread worth pursuing – could you copy and paste the entire contents of your main.cpp into a reply? Remember to include triple backticks (```) before and after your code, on their own lines, for formatting.
Thank you for this! I just tried it, and as soon as I ran the code, the pneumatic opened without me doing anything. Then, when I pressed the buttons, it wouldn’t do anything. Do you know why this is happening?
Follow what @jpearman says w/r/t where things are declared. Ideally, put all global declarations of Motors, Sensors, Brain, etc. in the same file (e.g. robot-config.cpp). I believe if you use the UI to define motors/sensors it does this automatically. I would guess you have the “expert” option ticked.