Our team is running two PCM’s do to the number of solenoids on the robot this year. We have figured out how to wire them up and understand that we have to change their IDs. But I am struggling on how to go about programming them in. The program is written in Java. If anyone had any ideas of where I could state it would be greatly appreciated, Thanks.
5576 - Programming
Have you tried passing the moduleNumber
to your solenoid?
/**
* Constructor.
*
* @param moduleNumber The module number of the solenoid module to use.
* @param forwardChannel The forward channel on the module to control (0..7).
* @param reverseChannel The reverse channel on the module to control (0..7).
*/
public DoubleSolenoid(final int moduleNumber, final int forwardChannel, final int reverseChannel)
I believe something like this should work:
DoubleSolenoid solenoidOne = DoubleSolenoid(0, 1, 2) // PCM 0 with channels 1 & 2
// or
Solenoid solenoidTwo = Solenoid(1, 1) // PCM 1 with channel 1
1 Like
Thank you for your help I’ll give it a try.
Hopefully that could be also useful