Shop OBEX P1 Docs P2 Docs Learn Events
Boe-bot class project using BS2p24 — Parallax Forums

Boe-bot class project using BS2p24

mikeyjunomikeyjuno Posts: 15
edited 2010-11-04 18:01 in BASIC Stamp
hello,
our class is doing a boe-bot based project as our final project. we all got assigned a boebot kit and have to "make it do things". basically if it drives (with interrupts such as the whiskers, or even the photo resistors) you get a B if it drives and can complete a task (literally any task) you get an A.

the problem is we havent been given any lessons on coding and are just using the boe-boe introduciton manual to program it. my current problem is that out of the 7 boe-bot kits that where assigned our group got a Bs2p24 chip (1 other group got this chip, the rest got the bs2). The basic code for like...centering the servo wheels (pulsout 750 and turning the servo till it stops) and just turning the servos on (pulsout a number thants not 750) seem to work but every other code i try from the manual doesnt work at all. Is there a simple conversion or something that i can put in with the code to make it run the bs2 codingthe two groups that got the bs2p24's are now very far behind the other groups because we cant even get the boe-bots to run forward for 3 seconds...
any help would be appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-11-02 20:28
    The Stamp Editor help files will show you how various timing constants are different between the BS2 and BS2p. These are used in the SERIN / SEROUT / PULSIN / PULSOUT / COUNT and other statements. PULSOUT is used to output servo control pulses. You can also look in the Stamp Manual for the same information (Basic Stamp Syntax and Reference Manual).

    Also check out the Robotics with the BoeBot tutorial.

    Look here and here.
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-02 23:02
    the robotics with the boe-bot is the text we've been following. Its easy to follow but when the code doesnt do what it says its supposed to its a little tough to troubleshoot.

    Im lost as to what im looking for im looking for in the stamp reference manual.

    "PULSOUT.bs2
    ' This program blinks an LED on for 25 ms at 1-second intervals. Connect an
    ' LED (active-low) to I/O pin 0.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    #SELECT $STAMP
    #CASE BS2, BS2E, BS2PE
    Scale CON 500 ' to ms for 2 us per unit
    #CASE BS2SX, BS2P, BS2PX
    Scale CON 1250 ' to ms for 0.8 us per unit
    #ENDSELECT
    Flash CON 25 * Scale ' 25 milliseconds
    Setup:
    HIGH 0 ' make P0 high (LED off)
    Main:
    PULSOUT 0, Flash ' flash LED
    PAUSE 1000 ' one second delay
    GOTO Main
    END"

    that all seems way more confusing then

    "' Robotics with the Boe-Bot – ServoP13Clockwise.bs2
    ' Run the servo connected to P13 at full speed clockwise.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    DEBUG "Program Running!"
    DO
    PULSOUT 13, 650
    PAUSE 20
    LOOP
    "

    i think we will just have to borrow a bs2 chip from one of the other groups or see if the teacher can order one.

    Edit:
    http://forums.parallax.com/showthread.php?p=769250
    the other group gave me this thread. Does this conversion work pretty well? anyone try this with a boe-bot and a bs2p
  • Mike GreenMike Green Posts: 23,101
    edited 2010-11-03 07:19
    The first example you posted uses the #SELECT statement to automatically adjust for the differences between the different Stamp models. You have to tell the Stamp Editor which model you're using.

    Instead of {$STAMP BS2} you have to use {$STAMP BS2P} otherwise the Stamp Editor thinks you have a BS2 and your program won't work.
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-04 17:27
    Mike Green wrote: »
    The first example you posted uses the #SELECT statement to automatically adjust for the differences between the different Stamp models. You have to tell the Stamp Editor which model you're using.

    Instead of {$STAMP BS2} you have to use {$STAMP BS2P} otherwise the Stamp Editor thinks you have a BS2 and your program won't work.

    well yeah the program actually detects what your using and offers to switch the program. all the ones ive been testing ive been using bs2p . my post above was just an example of how overly complicated this is seeming when using a different chip that should basically do the same thing.
  • hover1hover1 Posts: 1,929
    edited 2010-11-04 17:41
    I think what Mike was asking is, do you have the correct Directive at the start of your program:

    ' {$STAMP BS2P}
    ' {$PBASIC 2.5}

    Your example programs shows {$STAMP BS2} as the directive, which would be wrong for the BS2P.

    The IDE does not automatically find the version of Basic Stamp, you still have to tell it which version you have.
    Once you select the correct version Stamp that you are using {$STAMP BS2P}, THEN the CASE statements takes over to select the parameters indicated in the CASE statements.

    It's a little unclear if you are changing the the BS2 to BS2P in the program heading.

    Jim
  • ercoerco Posts: 20,256
    edited 2010-11-04 17:45
    mikeyj: Yours is a great problem to have; your higher performance BS2P24 is significantly faster and has more features, commands and potential than a "vanilla" BS2 . Its only limitation is that the huge library of BS2 software must be tweaked to run with it, but the post you mentioned shows how to do this:
    http://forums.parallax.com/showthread.php?p=769250


    If you're truly desperate, you could find a dozen people here to trade you a vanilla BS2 for your -P24. That would solve your immediate problem, but it would eliminate the many potential advantages of your -P24. I suggest you try tweaking a smaller program to get a feel for how straightforward the process is.

    You'll do the right thing!

    Best, erco
  • mikeyjunomikeyjuno Posts: 15
    edited 2010-11-04 17:46
    i have been changing the bs2 to bs2p each time. our lab tech found another bs2 chip though! so hopefully we can get our project on its way ill post more about it when we get farther along in the class project forum if we run into any other problems. thanks for all your help so far guys.
  • ercoerco Posts: 20,256
    edited 2010-11-04 17:47
    @Jim: Actually, the editor does recognize which Stamp is attached, and a popup window offers to correct the program's Stamp directive automatically. Pretty cool!
  • hover1hover1 Posts: 1,929
    edited 2010-11-04 17:55
    Darn! and I was thinkin' I had an easy fix. I must try and download a program to the wrong chip and see this happen. I just follow the rules too closely and never saw the correction come up.

    Sorry that did not help the OP.

    Jim
    erco wrote: »
    @Jim: Actually, the editor does recognize which Stamp is attached, and a popup window offers to correct the program's Stamp directive automatically. Pretty cool!
  • ercoerco Posts: 20,256
    edited 2010-11-04 18:01
    @Jim: No worries. The mere fact that I know that juicy tidbit proves that I've made that particular mistake myself! Since you didn't know, it means you haven't and you're the better man!
Sign In or Register to comment.