|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
programming
how does one go about changing forward to reverse in the edu robot ? Here is the code:
if rc_sw7 = 0 then skipOption7 p1_wheel = (((p1_wheel*154)/254)+100) max 254 'adjust wheel to 154-254 if drive_R < 127 then drive_R_reverse: 'is the right drive forward drive_R = (drive_R - 127) min 0 'subract 127 to get the forward value drive_R = (drive_R * p1_wheel)/254 'multiply by the wheel percentage drive_R = (drive_R + 127) max 254 'add 127 back for proper output goto drive_R_done: 'exit the drive right section drive_R_reverse: 'the right drive is reverse drive_R = (127 - drive_R) min 0 'invert drive-R to get a forward value drive_R = (drive_R * p1_wheel)/254 'multiply by the wheel percentage drive_R = (127 - drive_R) min 0 'invert drive_R back to normal drive_R_done: 'drive_R section complete if drive_L < 127 then drive_L_reverse: 'is the left drive forward drive_L = (drive_L - 127) min 0 'subract 127 to get the forward value drive_L = (drive_L * p1_wheel)/254 'multiply by the wheel percentage drive_L = (drive_L + 127) max 254 'add 127 back for proper output goto drive_L_done: 'exit the left right section drive_L_reverse: 'the left drive is reverse drive_L = (127 - drive_L) min 0 'invert drive-L to get a forward value drive_L = (drive_L * p1_wheel)/254 'multiply by the wheel percentage drive_L = (127 - drive_L) min 0 'invert drive_R back to normal drive_L_done: 'drive_L section complete skipOption7: we changed the less-than signs to greater-than and still nothing happened. Any ideas? |
|
#2
|
|||||
|
|||||
|
I think you're looking at the wrong chunk of code. This section (Option7) deals with the steering sensitivity. Option 6 is the one which deals with reversing the driving direction. To enable it, put a jumper on sw6.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Compatition | Angela06 | Programming | 30 | 08-04-2005 23:12 |
| multi-bank programming problem | GregC | Programming | 3 | 14-02-2003 16:13 |
| Pneumatics electrical wiring and programming | archiver | 2001 | 1 | 23-06-2002 23:10 |
| Error found in programming for the pump and pressure switch | sjharobotics | Programming | 4 | 06-02-2002 17:46 |
| pbasic programming | punarhero | Programming | 4 | 21-01-2002 23:32 |