|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
|||
|
|||
|
Re: Need help in creating program to use servo's to shift drive
Posted by Matt Starkey at 2/10/2001 3:12 PM EST
Engineer on team #236, Techno Ticks, from Lyme/Old-Lyme High School and Millstone Power Station. In Reply to: Re: Need help in creating program to use servo's to shift drive Posted by Barry Horwitz on 2/10/2001 11:27 AM EST: : : My building team developed a drive assembly that has a servo attached to the drive motor shifter. This will assembly will to shift from low to high gears. I am trying to control the shifting only when the joysticks are in dead stick position. I have the drive motors as PWM1 & 2. The servos are PWM 3 & 4. The trigger on joystick one controls the servos. The program now allows shifting all the time. I have tried to put conditional statements in the subroutine section and in the PWM limit switch control area. HELP!!! : : I need to put a statement in the program that will only allow the trigger to move PWM3&4 when the joystick is in dead stick position. Where in the program should this go and what might it look like? : :Barry You can put some conditional statements anywhere you want to as long as they are inside the main loop. Try using a series of "IF" statements if you are not too concearned with the loop time changing on you depending on the conditions. 1) is the trigger pulled? (assuming that the trigger is input that changes the position of the servo's). if not skip the rest of the routine. 2) if so, are the drive motors standing still (both equal to 127). If not, skip the rest of the routine. 3) if so, move the servo to the new position. Servo position will have to be stored between loops and a statement somewhere in the code (outside of the conditional statements) to set servo position to stored position each loop. Hope this helps -- Didn't want to give it away, but would be happy to answer any more questions. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 1 stick drive to 2 stick drive | wayne 05 | Programming | 18 | 01-04-2004 16:41 |
| Creating a dashboard program | Jeff_Rice | Programming | 18 | 04-05-2003 23:21 |
| what's your most important drive train advice? | Ken Leung | Technical Discussion | 42 | 07-01-2003 09:58 |
| Anyone looking for more program space? | archiver | 2001 | 13 | 24-06-2002 02:20 |
| "Motors and Drive train edition" of Fresh From the Forum | Ken Leung | CD Forum Support | 6 | 29-01-2002 12:32 |