Shop OBEX P1 Docs P2 Docs Learn Events
Help with Boebot for Mac — Parallax Forums

Help with Boebot for Mac

helpwithboebothelpwithboebot Posts: 3
edited 2010-10-06 16:18 in Robotics
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

Comments

  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2010-09-29 14:11
    Hello!

    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:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    

    Not this:
    ` {$STAMP BS2}
    ` {$PBASIC 2.5}
    

    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:
    ' {$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
    

    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
  • helpwithboebothelpwithboebot Posts: 3
    edited 2010-09-30 13:31
    oh ok, that was the problem, it kept putting italic ' and " and the program was saying un recognized character. i got it to download the first program, now im going to try to figure out how to center the servos, its just spinning around in a circle, but when i change the direction of one of them to -750, it doesnt move straight foward, it jumps around and still spins in a circle.
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2010-09-30 15:07
    Hey there,

    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
  • helpwithboebothelpwithboebot Posts: 3
    edited 2010-10-06 13:05
    Well this has turned out to be a complete failure. I still have not been able to do any of the labs because I am on Mac and the codes won't work in the 3rd party editor I downloaded. I would suggest getting a real Mac stamp editor in the future so your customers don't fail and waste lots of money.
  • FranklinFranklin Posts: 4,747
    edited 2010-10-06 16:09
    I would suggest getting a real Mac stamp editor in the future so your customers don't fail and waste lots of money.
    I'm glad you brought this up. Are you willing to write it? The MAC software is "Third Party" and not written by Parallax (who support the working windows version) You need to send your complaints to the author of the software if you don't like it and perhaps he will refund your money.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-06 16:18
    I have a Mac and have used Murat's Stamp Editor (MacBS2) for years. It's always "just worked" for me. Make sure you have the proper I/O driver installed for the USB to serial adapter you're using and keep in mind that a lot of the USB to serial adapters out there don't work for programming a Stamp (or Propeller for that matter). The ones with the FTDI chip like those from Parallax work fine.

    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.
Sign In or Register to comment.