Shop OBEX P1 Docs P2 Docs Learn Events
need help making program. — Parallax Forums

need help making program.

Nachos!!Nachos!! Posts: 3
edited 2010-10-02 07:12 in BASIC Stamp
I need some help getting a program to run on my boe-bot. It needs to go strait 4ft then make a 90 degree right turn and repeat this 7 times. Then it has to make a 45 degree right turn and move forward 2ft. When it comes to a stop it has to play a song. I have gotten it to do the 7 turns and I have written the song. I just cant figure out how to make it do the 45 degree turn, move up 2ft, and then put it all together to make it work correctly. Any help is greatly appreciated. Thanks!

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-10-01 14:09
    You can start by attaching the program you have to your next post. If you have a 90 turn you should get a 45 by doing only half of what you did to get 90.
  • Nachos!!Nachos!! Posts: 3
    edited 2010-10-01 21:22
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' Drew Prothro


    Counter VAR Word
    Turns VAR Word
    Turns = 1

    DO
    FOR counter = 1 TO 275 ' Boe-Bot moves forward 4 feet.
    PULSOUT 13, 850
    PULSOUT 12, 665
    PAUSE 20

    NEXT

    FOR counter = 1 TO 18 ' Boe bot makes 90 degree right turn.
    PULSOUT 13, 850
    PULSOUT 12, 850
    PAUSE 20
    NEXT

    Turns = (Turns + 1)
    LOOP WHILE (Turns <=7)

    END



    I tried adding the 45 degree turn and two feet forward but it wouldnt do it. Not sure what I need to do with it. Thanks again!
  • ercoerco Posts: 20,256
    edited 2010-10-01 22:32
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' Drew Prothro


    Counter VAR Word
    Turns VAR Word
    Turns = 1

    DO
    FOR counter = 1 TO 275 ' Boe-Bot moves forward 4 feet.
    PULSOUT 13, 850
    PULSOUT 12, 665
    PAUSE 20

    NEXT

    FOR counter = 1 TO 18 ' Boe bot makes 90 degree right turn.
    PULSOUT 13, 850
    PULSOUT 12, 850
    PAUSE 20
    NEXT

    Turns = (Turns + 1)
    LOOP WHILE (Turns <=7)

    FOR counter = 1 TO 9' Boe bot makes 45 degree right turn.
    PULSOUT 13, 850
    PULSOUT 12, 850
    PAUSE 20
    NEXT

    FOR counter = 1 TO 138 ' Boe-Bot moves forward 2 feet.
    PULSOUT 13, 850
    PULSOUT 12, 665
    PAUSE 20

    NEXT

    'insert song here

    END
  • Nachos!!Nachos!! Posts: 3
    edited 2010-10-02 07:12
    I tried doing it like that, but couldnt get it to act right. Maybe I left something out though. Ill give it another shot. Thanks for the help. :D
Sign In or Register to comment.