Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Toggle switch with pneumatic (http://www.chiefdelphi.com/forums/showthread.php?t=35063)

The yellowdart 20-02-2005 17:02

Toggle switch with pneumatic
 
does anyone know how to program a toggle switch?

we want to use it as an on/off switch
for up / down with our casters

(we want to toggle the state of our relay by pressing a 1 button)

i tried the code for the toggle and was unsucessful

if anyone has any code, please post and say where the lines go

or if anyone knows where i can find some good code, please let me know

thoughtful 20-02-2005 17:49

Re: Toggle switch with pneumatic
 
I am trying to remember this on top of my head so here it goes:

Get a toggle switch. Wire Pin 1 of the DB-15 cable to one pin on the toggle switch. Connect the other pin to 10 on the DB-15 connecter. This should work for pX_sw_aux1 (or aux2: not sure) . X is the port number. I would suggest use port 3 or 4, its on the other side of the OI and mostly easier to layout your OI.

With this all you have to do is

relayX_fwd=pX_sw_aux1;

So when the button is in on position the solenoid is active and in off its not. (this will work for a single solenoid)

you can put the code in user_routines.c under where other relays have values assigned. I dont remember the exact line number.

Any questions are welcomed

whakojacko 21-02-2005 14:08

Re: Toggle switch with pneumatic
 
yes that will work, but that only goes one direction. Might you alsos want another line relayX_rev=!pX_sw_aux1;? That way itll go both directions


All times are GMT -5. The time now is 10:43.

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