Help with Boebot for Mac
helpwithboebot
Posts: 3
i have been trying to program my boebot on my mac, and have not had any success yet and am really starting to fall behind in lab. any help would be appreciated.
when i copy/past this code in to center my servos i keep getting "unknown target module... $STAMP directive not found"..
even when i delete the ' CenterServos part at the top it still doesnt work.
‘ CenterServos
‘ {$STAMP BS2}
‘ {$PBASIC 2.5}
DEBUG “Program Running...”
DO
PULSOUT 12, 750
PULSOUT 13, 750
PAUSE 20
LOOP
END
what am i doing wrong?
also when i try to do the next step (even though i havent been able to center my servos), once i finally got it to submit the code to my boebot (i had to delete one of the "driving test"s for my robot to function..), it just acts crazy and spins side to side irregularly and stops..
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Driving Test...", CR
i VAR Byte
Lspeed VAR Byte
Rspeed VAR Byte
Lspeed = 20 ' Set how fast the left servo moves
Rspeed = 20 ' Set how fast the right servo moves
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Driving Test...", CR
i VAR Byte
Lspeed VAR Byte
Rspeed VAR Byte
Lspeed = 20 ' Set how fast the left servo moves
Rspeed = 20 ' Set how fast the right servo moves
DEBUG "Backward..."
FOR i = 1 TO 40
PULSOUT 12, 750+Rspeed
PULSOUT 13, 750-Lspeed
PAUSE 20
NEXT
DEBUG "Turn Left..."
FOR i = 1 TO 40
PULSOUT 12, 750-Rspeed
PULSOUT 13, 750-Lspeed
PAUSE 20
NEXT
DEBUG "Turn Right..."
FOR i = 1 TO 40
PULSOUT 12, 750+Rspeed
PULSOUT 13, 750+Lspeed
PAUSE 20
NEXT
DEBUG “Finished.”, CR
END
when i copy/past this code in to center my servos i keep getting "unknown target module... $STAMP directive not found"..
even when i delete the ' CenterServos part at the top it still doesnt work.
‘ CenterServos
‘ {$STAMP BS2}
‘ {$PBASIC 2.5}
DEBUG “Program Running...”
DO
PULSOUT 12, 750
PULSOUT 13, 750
PAUSE 20
LOOP
END
what am i doing wrong?
also when i try to do the next step (even though i havent been able to center my servos), once i finally got it to submit the code to my boebot (i had to delete one of the "driving test"s for my robot to function..), it just acts crazy and spins side to side irregularly and stops..
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Driving Test...", CR
i VAR Byte
Lspeed VAR Byte
Rspeed VAR Byte
Lspeed = 20 ' Set how fast the left servo moves
Rspeed = 20 ' Set how fast the right servo moves
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Driving Test...", CR
i VAR Byte
Lspeed VAR Byte
Rspeed VAR Byte
Lspeed = 20 ' Set how fast the left servo moves
Rspeed = 20 ' Set how fast the right servo moves
DEBUG "Backward..."
FOR i = 1 TO 40
PULSOUT 12, 750+Rspeed
PULSOUT 13, 750-Lspeed
PAUSE 20
NEXT
DEBUG "Turn Left..."
FOR i = 1 TO 40
PULSOUT 12, 750-Rspeed
PULSOUT 13, 750-Lspeed
PAUSE 20
NEXT
DEBUG "Turn Right..."
FOR i = 1 TO 40
PULSOUT 12, 750+Rspeed
PULSOUT 13, 750+Lspeed
PAUSE 20
NEXT
DEBUG “Finished.”, CR
END
Comments
The error you are receiving for your first program means that the compiler doesn't know what BASIC Stamp it is supposed to program. I can't be 100% positive, but it looks like you're using the grave accent ` (which shares a key with the tilde ~) instead of the single quote for your compiler directive. In other words it should be this:
Not this:
Did you try reinserting the directives into your program and running it again?
I've also tried running your second program in my Boe-Bot, and it worked as expected. I noticed that you have these lines:
repeated in the program above. The program shouldn't be able to run with this copied twice, but could cause problems if MacBS2 allows it to run. Is it that way your code is entered in MacBS2?
Another thing to check is your Boe-Bot's batteries. Sometimes drained batteries can cause sneaky problems.
Hope this helps!
-- Jessica
Check out Chapter 2, Activity #4 on pages 66-70 of Robotics with the Boe-Bot. It gives step-by-step instructions on how to center the servo motors.
750 should actually be your "Stop" pulse, meaning the servos shouldn't rotate when receiving that PULSOUT duration. 850 should be you full speed counter-clockwise rotation, and 650 should be your full speed clockwise rotation.
Hope this helps, let us know if you run into any other problems!
-- Jessica
If you don't have a Stamp directive in your program, there is a Stamp menu that lets you select which version of PBASIC you're using and which Stamp module you're compiling for. Note that MacBS2 hasn't been updated to handle the BS2px and has never handled the BS1, but that's not an issue for most people.