My Robot in form 2!
Still stays there.
The servo keeps twitching.
The srf05 is supposed to take readings but it doesnt do it in the right time.
Currently the sensor is off the servo(The body of the robot).
(UPDATE 4.12.11)
The sensor is attached back on.
and here is the code that needs work on.
dunno how to attach bas file to posts
symbol range = w0
symbol rangecm = w1
symbol leftr = w2
symbol rightr = w3
servo B.0, 150
main:
pause 10
pulsout C.0, 2
pulsin C.0, 1, range
rangecm = range*5/58
do while rangecm > 10
forward A : forward B
pause 10
pulsout C.0, 2
pulsin C.0, 1, range
rangecm = range*5/58
loop
gosub scanandstop
if leftr > rightr then
sertxd ("Left is bigger")
else
sertxd ("Right is bigger")
end if
goto main
{
scanandstop:
halt A : halt B
servo B.0, 75
pause 10
pulsout C.0, 2
pulsin C.0, 1, range
rightr = range*5/58
wait 1
servo B.0, 150
wait 1
servo B.0, 225
pause 10
pulsout C.0, 2
pulsin C.0, 1, range
leftr = range*5/58
wait 1
return
}
Same as start here, obstacle avoidance
- Actuators / output devices: 2 dc motors with worm gear and 1 mini servo
- Control method: auto
- CPU: Picaxe 20x2
- Operating system: Linux, Windows, and Mac
- Power source: 3 aaa duracell!
- Programming language: Basic
- Sensors / input devices: SRF05
- Target environment: indoor