📜  螺线管 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:12.360000             🧑  作者: Mango

代码示例1
Solenoid exampleSingle = new Solenoid(PneumaticsModuleType.CTREPCM, 0);
DoubleSolenoid exampleDouble = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, 1, 2);

// Initialize the DoubleSolenoid so it knows where to start.  Not required for single solenoids.
exampleDouble.set(kReverse);

if (m_controller.getYButtonPressed()) {
   exampleSingle.toggle();
   exampleDouble.toggle();
}