Shop OBEX P1 Docs P2 Docs Learn Events
boe bot help. — Parallax Forums

boe bot help.

k.ck.c Posts: 5
edited 2009-12-20 15:25 in Robotics
I'm new to· robotics and im working on ch 4. I just finished pg 145 "Movement with variables and one subroutine. Well, Im not understanding the next project on p 146 which is titled Your turn "dead Reconing".

· Basically, the book is saying to modify the Movement with variables and one subroutine program with the
values from activity 2 pg 132.· I have my pulsout values from pg 132.

·My question is on my navigate for/next loop. Im not understanding the pulsout 13, pulseleft and pulsout 12, pulseRight.. Shouldnt i be able to declare my values in the GOSUB routines above the for/next loop and state in my for next loop (for example)·:

Navigate:
· for counter = 1 to pulseCount
···· pulsout 13, pulseforward····················· ' Move Forward
···· pulsout 12, pulseforward
· next
· pause 200
·
· for counter = 1 to pulseCount·················· ' Turn left
····· pulsout 13, pulseleft
····· pulsout 12, pulseleft

and so on. I guess im not understanding this "your turn" exercise,,any help for me would be very much appreciated.· thank you
·

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-12-19 21:28
    Hi K.C.,

    A couple of comments when looking at the code you posted (I haven't looked the exercises up in the book though):
    1) When working with servos, you need a delay between pulses. Usually this delay is about 20ms. Don't forget to add one into your loops.
    2) If you send the same pulse value to both servos, the boe-bot will just spin. Since the servos are mounted opposite each other, a high value on one side will make that side go forward, while a high value on the other side will make that side go backwards. Hence, your constants (or variables, I can't tell) pulseforward and pulseleft will simply make the boe bot spin


    You can try this with a simple program. Something like this might work (untested, uncompiled so there may be errors)
    counter VAR Byte
    
    FOR counter = 0 TO 255
       PULSOUT 13, 900
       PULSOUT 12, 900
       PAUSE 18
    NEXT
    
    



    Redownloading this program multiple times with different values on the pulsouts will allow you to experiment.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • k.ck.c Posts: 5
    edited 2009-12-20 15:25
    Thanks, I'll try it today, I'll eventually get it.. I appreciate you help. k.c
Sign In or Register to comment.