|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#32
|
|||
|
|||
|
Re: A New Programmer
Hi,
You can try this, but I don't make any guarantee. Toggle_gripper(current state) { int temp_state; If ((p3_sw_trig==TRUE)&&( current _state== CLOSED) temp_state=current_state; else if (p3_sw_trig==TRUE) temp_state=OPEN; else if ((p3_sw_trig==FALSE)&&(current_state==OPEN)) temp_state=current_state; else if ((p3_sw_trig==FALSE) temp_state=CLOSED; } return (temp_state); In you Default _Routine, simply call the function: pwm_state=Toggle_Gripper(current_pwm); if (current_pwm<>pwm_state) pwm=pwm_state; I'm writing this off the cuff, you will need to correct the syntax and apply your own values for the pwm assignments, but it looks plausable. Good luck. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NEW PROGRAMMER!!!!! NEED HELP!!!! | delphi demon | Programming | 5 | 19-04-2007 13:22 |
| pic: Team 1249's new programmer | roborat | Extra Discussion | 4 | 23-06-2006 22:02 |
| Senior Programmer: advice on training new recruits | Jeff_Rice | Programming | 9 | 04-01-2005 16:59 |
| Help for New Programmer | Mike375 | Programming | 3 | 27-09-2001 09:04 |