Here I've made an attempt at re-writting this code in PBasic for the 2001-2002 controllers, here is the section of code, it SHOULD work, but I have no method of testing it right now. Also, for this to work, the variables "toggled" "prev_toggle" and "run_auto" must be created and initially set to 0.
Code:
IF (p1_aux = 1) & (prev_toggle = 0) THEN Toggler:
Toggler:
toggled = 1
run_auto = 1
prev_toggle = p1_aux
IF (p1_aux = 1) & (run_auto = 1) THEN StopAuto:
StopAuto:
toggled = 0
run_auto = 0
IF (run_auto = 1) THEN GoAuto:
driveR = (((2000 + p1_y + p1_x - 127) MIN 2000 MAX 2254) - 2000)
driveL = (((2000 + p1_y - p1_x + 127) MIN 2000 MAX 2254) - 2000)
GoAuto:
' Autonomous Code Goes Here
Just place this code into the drive section and hopefully it will work. I don't have much experience with PBasic, so if there are any errors, please tell me.
__________________
2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed