Asked
— Edited

i get an error trying to use the ping sensor.something about matrix is not good.
and the text is in nederlands written
bigger pic
i get an error trying to use the ping sensor.something about matrix is not good.
and the text is in nederlands written
bigger pic
@nomad.
Good to see it working. I won't give you the script to do what you asked, but I'll give you some clues to what you need so you can Give it a try.
If the ping sensor reads over 50, play sonar sound and rotate the servo.
or else if ping sensor reads below 50, stop sonar sound effect and say "danger".
Put in a sleep command.
Go to the start of the script and do the process again.
The clues of what script commands you need are written above. Give it a try and report back.
Good luck.
steve g thats a huge task for me ,give me a couple off months haha just kidding. i like the way you teach.ok let see wht i can find. eek
@nomad.
No problem. Truth be told, I'm not 100% sure how to write the script as im still learning too, but I understand the principles and what's needed...
If over 50, scan and play sonar sound
Elseif under 50, stop scan and sonar sound and say "Danger".
If I had my laptop with me I could probably write the script okay, but I'm away for the weekend so can't give you more than that for now.
rr
steve g gonna like this code
Maybe a better script..
@Richard.
That's a new one for me. I haven't come across that before.
Steve, :Top is a label for the Goto command
Goto will "jump" to the label
A script starts from the top and reads each line downward
When the line reads GOTO(label), then the script will jump to the label. In this case, the label is called TOP. You can name the label anything you want.
You can name the label CHICKEN, if you like chickens. Or you can name it something that identifies what it is for, in which case CHICKEN wouldn't make sense.
Richard used TOP because it's the top of the script. He could have named it anything, but it's nice to name it something that us humans can understand when reading the code back.
For more information, load the GOTO RETURN STACK.EZB project located in Examples\EZ-Script Function Syntax folder