Shop OBEX P1 Docs P2 Docs Learn Events
Pwmpal bs 2 — Parallax Forums

Pwmpal bs 2

h3n7yh3n7y Posts: 11
edited 2009-05-10 04:04 in BASIC Stamp
THIS IS THE CODE I wrote for the Basic stamp to control the PWMPAL and according to the low and high position it will steer right of left, but Is not working so tell me what I am doing wrong? and why is not so much articleregarding the PWMPAL, I have it connected on the 24 socket and bs2 on top of the pwmpal but is not ··' {$STAMP BS2}' {$PBASIC 2.5}
PPpin CON 0 bs2 and pwmpal conection
MotorNum CON 1 ' PWMPAL motor output

DFORW CON 6DBACK CON 5STEERR CON 2STEERL CON 3GOSUB initDO GOSUB turnoff GOSUB driveoff PAUSE 2000 GOSUB driveback PAUSE 1000 GOSUB driveoff GOSUB skitchleft PAUSE 100 GOSUB driveforward PAUSE 1000 GOSUB turnright PAUSE 500 GOSUB turnoff PAUSE 500 GOSUB turnright PAUSE 600 GOSUB turnoff PAUSE 500 GOSUB turnright PAUSE 300 GOSUB turnleft PAUSE 800 GOSUB turnoff GOSUB turnoff GOSUB driveoff PAUSE 100 GOSUB turnright GOSUB driveback PAUSE 1000 GOSUB skitchleft PAUSE 500 GOSUB skitchleft PAUSE 500 GOSUB driveforward PAUSE 2000 GOSUB driveoff GOSUB turnoff DEBUG "looped" , CRLOOPENDinit: GOSUB turnoff GOSUB driveoffRETURNturnleft: LOW STEERR HIGH STEERLRETURNturnright: LOW STEERL HIGH STEERRRETURNturnoff: LOW STEERL LOW STEERRRETURNdriveback: LOW DFORW HIGH DBACKRETURNdriveforward: LOW DBACK HIGH DFORWRETURNdriveoff: LOW DBACK LOW DFORWRETURNskitchleft: GOSUB turnleft GOSUB driveforward PAUSE 1000 GOSUB turnoff GOSUB driveoff PAUSE 100 GOSUB turnright GOSUB driveback PAUSE 1000 GOSUB turnoff GOSUB driveoffRETURNskitchright: GOSUB turnright GOSUB driveforward PAUSE 1000 GOSUB turnoff GOSUB driveoff PAUSE 100 GOSUB turnleft GOSUB driveback PAUSE 1000 GOSUB turnoff GOSUB driveoffRETURN·

Comments

Sign In or Register to comment.