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
#baloo
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
this what i have so far see code below 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
sounds like you want to use the radar control?
hi DJ my own radar ? so how do i use getping(d13,d12) in an if statment .. if possible
hi dj i am doing it this way just to learn about some of the script command you have showen on the help page
The most powerful commands for something like this are the WAIT commands. For example...
And then you'll want to move the head back and forth... So create another script that does it...
Hi DJ 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
Turn left
and your scan to
Nice It'll use a lot more processing to hav two scripts for movement. How come you separated them?
hi DJ it would not do a right()?
Strange. Works in my test when I wrote it.
hi DJ i'll play with the timing of the scan etc.
Okie
Ah you know what? Maybe don't have it move from 10 to 80 because that might be what's happening. Have it move from 10 to 40. The. 40 to 80. Then 80 to 40. Then 40 to 10.
Repeat
Also, if you get the latest ARC... There is a C# example for a radar control. Look under File -> Examples -> Script C Radar Control
hi DJ Thanks i did a little mod