boe bot help.
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
·
· 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
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)
Redownloading this program multiple times with different values on the pulsouts will allow you to experiment.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Powered by enthusiasm