Shop OBEX P1 Docs P2 Docs Learn Events
Begginner Project- Super Boe-Bot roamer — Parallax Forums

Begginner Project- Super Boe-Bot roamer

A.C. fishingA.C. fishing Posts: 262
edited 2006-03-03 03:37 in Robotics
I just finished making my Boe-Bot roam with both Whiskers and IRs. Because you don't need any parts that arn't included with the bot, it is good for begginners.
here's the code:
' {$STAMP BS2}
' {$PBASIC 2.5}

DO
IF (IN0 = 0) AND (IN9 = 0) AND (IN5 = 0) AND (IN7 = 0) THEN
PULSOUT 13, 650
PULSOUT 12, 850
ELSEIF (IN0 = 0) AND (IN9 = 0) THEN
PULSOUT 13, 650
PULSOUT 12, 850
ELSEIF (IN5 = 0) AND (IN7 = 0)  THEN
PULSOUT 13, 650
PULSOUT 12, 850
ELSEIF (IN0 = 0) AND (IN5 = 0) THEN
PULSOUT 13, 850
PULSOUT 12, 850
ELSEIF (IN7 = 0) AND (IN9 = 0)  THEN
PULSOUT 13, 650
PULSOUT 12, 650
ELSEIF (IN7 = 0) THEN
PULSOUT 13, 650
PULSOUT 12, 650
ELSEIF (IN9 = 0)  THEN
PULSOUT 13, 650
PULSOUT 12, 650
ELSEIF (IN0 = 0) THEN
PULSOUT 13, 850
PULSOUT 12, 850
ELSEIF (IN5 = 0)   THEN
PULSOUT 13, 850
PULSOUT 12, 850
ELSEIF (IN0 <> 0) AND (IN9 <> 0) AND (IN5 <> 0) AND (IN7 <> 0)    THEN
PULSOUT 13, 850
PULSOUT 12, 650
ELSEIF (IN0 <> 0) AND (IN9 <> 0)      THEN
PULSOUT 13, 850
PULSOUT 12, 650
ENDIF
LOOP

If anybody can show me a good robotics scematic software that is FREE i can draw a schematic
Thanks
ACfishing

Comments

  • neotericneoteric Posts: 144
    edited 2006-03-02 21:42
    Congrats on completing your robot!· The code looks pretty straight forward! Nice.

    In lieu of a schematic, you·might want to look at how others comment thier code, using the apostrophe· '
    This would make your code much more usable to others, and could eliminate the need for a schematic.· It could also help you in a month or so when you pull the code out to use it on something else.· At least that is what has helped me recently.· I have several saved versions of code, per project, and several projects in progress.
    [size=2][code]
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    '---- PINOUTS ------
    ' Pins 0, 9, are front whiskers
    ' Pins 13, 12 are left, right servos
    ' Pins 5, 7 are front IR detection pairs
    '---- Main Program
    DO
    IF (IN0 = 0) AND (IN9 = 0) AND (IN5 = 0) AND (IN7 = 0) THEN
    PULSOUT 13, 650
    PULSOUT 12, 850
    ELSEIF (IN0 = 0) AND (IN9 = 0) THEN
    PULSOUT 13, 650
    PULSOUT 12, 850
    ....
    


    [/code][/size]
    Thanks for sharing. If you keep building, and sharing, you'll be much loved for sharing, with ' comments.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-03 03:37
    This post is being moved to the Robotics Forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.