Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Programming Double Solenoids (http://www.chiefdelphi.com/forums/showthread.php?t=126282)

ShaneKent253 11-02-2014 22:00

Programming Double Solenoids
 
Hello from team 253,

How do you program double solenoids. Please answer with some example code.


Thank You!

Shane

Domenic Rodriguez 11-02-2014 22:37

Re: Programming Double Solenoids
 
The DoubleSolenoid class is pretty easy to work with:
Code:

// Create a double solenoid with the forward channel in port 1 and the reverse
// channel in port 2
DoubleSolenoid solenoid = new DoubleSolenoid(1, 2);

// Setting values
solenoid.set(DoubleSolenoid.Value.kForward);  // Set the solenoid to forward
solenoid.set(DoubleSolenoid.Value.kReverse);  // Set the solenoid to reverse
solenoid.set(DoubleSolenoid.Value.kOff);      // Turn off the solenoid



All times are GMT -5. The time now is 09:32.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi