
baloo
Australia
Asked
— Edited
hi all
I am writing my own radar script
how do i use the value return by getping(d13,d12)
e.g.
:loop tr
if getping(d13,d12) < 20
then Right(200)
goto(tr)
else
stop script and exit
Don't know if you can 'mix n match' the if and getping functions like that??
you need to test the value Getping returns with an if statement afterwards. Lots easier to use ping_wait
i what to test to see if the distance is under 15", if so turn robot to the right or left, depending on where it is looking
Code:
my own radar ?
so how do i use getping(d13,d12)
in an if statment .. if possible
i am doing it this way just to learn about some of the script command you have showen on the help page
Code:
And then you'll want to move the head back and forth... So create another script that does it...
Code:
thanks for the help
I broke your move script into 2 scripts
I just need to fine tune the time, to get it all to run smooth:D
turn right
Code:
Turn left
Code:
and your scan to
Code:
It'll use a lot more processing to hav two scripts for movement. How come you separated them?
it would not do a right()?
i'll play with the timing of the scan etc.
Repeat
Thanks
i did a little mod
1. it move forward after turning
2. scan rate is faster
3. it works
Code: