![]() |
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? |
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.
|
| All times are GMT -5. The time now is 13:51. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi