Created
March 4, 2016 15:00
-
-
Save Spartan322/e4e1f77ecf165aa28bc3 to your computer and use it in GitHub Desktop.
WHS Robotics 2016 - George & Visal: Vorge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' SumoBot-2.2-Motor-Test.BS2 | |
' {$STAMP BS2} | |
' {$PBASIC 2.5} | |
' -----[ I/O Definitions ]------------------------------------------------- | |
LMotor PIN 13 ' left servo motor | |
RMotor PIN 12 ' right servo motor | |
' -----[ Constants ]------------------------------------------------------- | |
LFwdFast CON 1000 ' left motor fwd; fast | |
LFwdSlow CON 800 ' left motor fwd; slow | |
LStop CON 750 ' left motor stop | |
LRevSlow CON 700 ' left motor rev; slow | |
LRevFast CON 500 ' left motor rev; fast | |
RFwdFast CON 500 ' right motor fwd; fast | |
RFwdSlow CON 700 ' right motor fwd; slow | |
RStop CON 750 ' right motor stop | |
RRevSlow CON 800 ' right motor rev; slow | |
RRevFast CON 1000 ' right motor rev; fast | |
' -----[ Variables ]------------------------------------------------------- | |
pulses VAR Byte ' servo pulses counter | |
' -----[ Initialization ]-------------------------------------------------- | |
Reset: | |
LOW LMotor ' initialize motor outputs | |
LOW RMotor | |
PAUSE 2000 ' time to disconnect cable | |
' -----[ Program Code ]---------------------------------------------------- | |
Main: | |
FOR pulses = 1 TO 33 ' fwd slow, ~6 inches, L VA-VB | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 270 degs, VB | |
PULSOUT LMotor, LRevSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches, L VB-VC | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 270 degs, VC | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 33 ' fwd slow, ~6 inches, L VC-VA2 | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 16 ' turn 315 degs, VA2 | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 33 ' fwd slow, ~6 inches, L VA2-VB2 | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 270 degs, VB2 | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches, L VB2-VC2 | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 270 degs, VC2 | |
PULSOUT LMotor, LRevSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 33 ' fwd slow, ~6 inches, L VC2-VA | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 8 ' turn 315 degs, VA | |
PULSOUT LMotor, LRevSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
Hold_Position: | |
DO | |
PULSOUT LMotor, LStop | |
PULSOUT RMotor, RStop | |
PAUSE 20 | |
LOOP | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' SumoBot-2.2-Motor-Test.BS2 | |
' {$STAMP BS2} | |
' {$PBASIC 2.5} | |
' -----[ I/O Definitions ]------------------------------------------------- | |
LMotor PIN 13 ' left servo motor | |
RMotor PIN 12 ' right servo motor | |
' -----[ Constants ]------------------------------------------------------- | |
LFwdFast CON 1000 ' left motor fwd; fast | |
LFwdSlow CON 800 ' left motor fwd; slow | |
LStop CON 750 ' left motor stop | |
LRevSlow CON 700 ' left motor rev; slow | |
LRevFast CON 500 ' left motor rev; fast | |
RFwdFast CON 500 ' right motor fwd; fast | |
RFwdSlow CON 700 ' right motor fwd; slow | |
RStop CON 750 ' right motor stop | |
RRevSlow CON 800 ' right motor rev; slow | |
RRevFast CON 1000 ' right motor rev; fast | |
' -----[ Variables ]------------------------------------------------------- | |
pulses VAR Byte ' servo pulses counter | |
' -----[ Initialization ]-------------------------------------------------- | |
Reset: | |
LOW LMotor ' initialize motor outputs | |
LOW RMotor | |
PAUSE 2000 ' time to disconnect cable | |
' -----[ Program Code ]---------------------------------------------------- | |
Main: | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 90 degs | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 90 degs | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 17 ' turn 90 degs | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
Hold_Position: | |
DO | |
PULSOUT LMotor, LStop | |
PULSOUT RMotor, RStop | |
PAUSE 20 | |
LOOP | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' SumoBot-2.2-Motor-Test.BS2 | |
' {$STAMP BS2} | |
' {$PBASIC 2.5} | |
' -----[ I/O Definitions ]------------------------------------------------- | |
LMotor PIN 13 ' left servo motor | |
RMotor PIN 12 ' right servo motor | |
' -----[ Constants ]------------------------------------------------------- | |
LFwdFast CON 1000 ' left motor fwd; fast | |
LFwdSlow CON 800 ' left motor fwd; slow | |
LStop CON 750 ' left motor stop | |
LRevSlow CON 700 ' left motor rev; slow | |
LRevFast CON 500 ' left motor rev; fast | |
RFwdFast CON 500 ' right motor fwd; fast | |
RFwdSlow CON 700 ' right motor fwd; slow | |
RStop CON 750 ' right motor stop | |
RRevSlow CON 800 ' right motor rev; slow | |
RRevFast CON 1000 ' right motor rev; fast | |
' -----[ Variables ]------------------------------------------------------- | |
pulses VAR Byte ' servo pulses counter | |
' -----[ Initialization ]-------------------------------------------------- | |
Reset: | |
LOW LMotor ' initialize motor outputs | |
LOW RMotor | |
PAUSE 2000 ' time to disconnect cable | |
' -----[ Program Code ]---------------------------------------------------- | |
Main: | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 25 ' turn 120 degs | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 25 ' turn 120 degs | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 65 ' fwd slow, ~12 inches | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RFwdSlow | |
PAUSE 20 | |
NEXT | |
FOR pulses = 1 TO 25 ' turn 120 degs | |
PULSOUT LMotor, LFwdSlow | |
PULSOUT RMotor, RRevSlow | |
PAUSE 20 | |
NEXT | |
Hold_Position: | |
DO | |
PULSOUT LMotor, LStop | |
PULSOUT RMotor, RStop | |
PAUSE 20 | |
LOOP | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment