I am trying to make my double solenoid so that when I start the valve are closed, so the piston doesn’t fly out but I don’t know how to do this I don’t have any code for it either.
I’m not 100% clear on your situation or end goal, but have you looked into this description of valve types and controlling FRC valves in java?
Remember your user code doesn’t start running till at least 30 seconds after power-on. This is the first chance any user-written code could potentially control the state of the robot.
Remember too that your mechanical design should be such that, with no software running, the robot remains in a “safe” state. Depending on your mechanism, This may imply you need to reverse the piping on the valve or change valve types to ensure a safe default position
.