|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Toggle between in and out (Pneumatics)
How can we program the pneumatics to toggle between in and out? Right now we can only leave the piston out by holding the button down. How can we set it up to toggle?
Thanks |
|
#2
|
||||||
|
||||||
|
are you using a single or double solenoid. What type of switch are you using (spst, dpdt, momentary, locking, etc). That's the bare minimum information, because each combination would have a different line (or lines) of code to work.
|
|
#3
|
||||
|
||||
|
i believe we are using a double solenoid
|
|
#4
|
||||
|
||||
|
You probably have something like this:
relayX_fwd = pX_sw_trig You need something like this: if (pX_sw_trig) then relayX_fwd = 1 if (pX_sw_top) then relayX_fwd = 0 If using two buttons is out of the question, you'll have to get a bit more creative: if ((pX_sw_trig ~= LastState) & (pX_sw_trig = 1)) then relayX_fwd = OpenClose OpenClose = OpenClose - 1 endif LastState = pX_sw_trig |
|
#5
|
||||||
|
||||||
|
Quote:
|
|
#6
|
|||||
|
|||||
|
umm... im using &, and ~= and their working just fine in my code...
and they are used in the default code from I.F. |
|
#7
|
||||||
|
||||||
|
Quote:
Quote:
http://www.chiefdelphi.com/forums/sh...threadid=18007 http://www.chiefdelphi.com/forums/sh...hlight=bitwise http://www.chiefdelphi.com/forums/sh...hlight=bitwise |
|
#8
|
|||||
|
|||||
|
yea my bad on the first one.. that one doesent work*bops self in head*
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|