|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
||||
|
||||
|
Re: PROGRAMMING PNEUMATICS
It's actually fairly simple to have the trigger control an action with the pneumatics. What have you to do is declare some variable like handstate.
Then when your trigger is pressed changed the value of handstate to 1 or 0. Then when the trigger is pressed you know whether your hand is opened or closed and you can do an action based on it. Code:
int handstate;
handstate = 0; //default position for whatever your using
if (p1_sw_trig == 1 && handstate == 0)
{
relay2_fwd = 1;
handstate = 1;
}
if (p1_sw_trig == 1 && handstate == 1)
{
relay2_rev = 1;
handstate = 0;
}
Last edited by dpick1055 : 25-02-2007 at 01:09. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| programming the pneumatics | Armando | Programming | 2 | 17-02-2007 21:47 |
| Programming Pneumatics? | itzrobz | Programming | 2 | 20-01-2007 00:30 |
| Programming of Pneumatics | Ben Piecuch | Programming | 3 | 18-02-2005 02:39 |
| Pneumatics Programming | KWalsh | Programming | 8 | 19-02-2004 09:17 |
| Programming PBASIC for pneumatics | archiver | 2001 | 2 | 23-06-2002 23:58 |