Quote:
Originally Posted by mother_russia
Hello, tonight is the night before my team's first competition. And for some f  cking reason, the robot is still not ready. In addition to me not being able to troubleshoot my code, the inspectors came around and totally overrode our solenoid system. Now we wave to use a solenoid breakout board. I have no idea what the hell that is and how to program it. What is it and how could I program it. Any replies will be appreciated.
|
What wireties said above is definitely true. You need to use 2 pin cables, but as far as I know, you could also have the solenoid actuated from a spike, which would be powered from digital sidecar via PWM. If you want to continue using the solenoid breakout board, the code doesn't need to change that much. If you are using C++ or Java, you instantiate a new Solenoid (or double) with the parameters being which port the solenoid is plugged into the solenoid breakout board. I am not familiar with lab view, but maybe someone else can explain how to code it there. This would be an example:
Code:
//Single Solenoid
Solenoid piston = new Solenoid (portNumber);
//Double Solenoid
DoubleSolenoid piston2 = new DoubleSolenoid (portANumber, portBNumber);
Something worth noting is that actuating single and double solenoids in C++/Java are done in different ways. This is due to the fact that a double solenoid has no default position.
Code:
//Single Solenoid actuation
piston.set(true);
piston.set(false);
//double solenoid actuation
piston2.set(DoubleSolenoid.Value.kForward);
piston2.set(DoubleSolenoid.Value.kReverse);