sonar robot
smartg
Posts: 26
hey. me again i know you must be thinking im repeating a topic i have already done.well i decided i dont want to buy the extra servo.i wanted my robot to see the obostacle then turn 90 dergrees to to the right or close to it.·and when i tried my program it would sometimes work then after a few turns it just started to turn as if something was there but nothing was. when my BOE was on 1 the ping sesor acted· fine ,i could tell by the led on it. now all does is turn. heres my program:
var··· word·· time
·strart:
·· pulsout x,500
·· pulsin x· time
·if time < x then forward
·if time> x· then right
· forward: pulsout 12,900
············· pulsout 13,600
· right:·····pulsout 12,900
············· pulsout 13,900·
var··· word·· time
·strart:
·· pulsout x,500
·· pulsin x· time
·if time < x then forward
·if time> x· then right
· forward: pulsout 12,900
············· pulsout 13,600
· right:·····pulsout 12,900
············· pulsout 13,900·
Comments
You don't have x defined and you are assigning it to a word and using it as a pin definition. Work further on your code. Do you have the downloads What is a microcontroller and the boebot download? If not get them, read them, understand them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
tell me whats wrong? did you mean to do what i want is wrong or i wrote this code wrong.
www.parallax.com/Portals/0/Downloads/docs/books/edu/RoboticsV2_2.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen