Asked
— Edited
Hello,
i need help for a script for the Ultrasonic Sensor.
How i can make a script for diffrent commands on diffent distances?
My exampel ScriptCode:
:loop
$proxclose = 30
$proxsense = GetPing(D21,D22)
IF($proxsense < $proxclose)
SayEZB("You are to near")
EndIf
$proxclose = 100
$proxsense = GetPing(D21,D22)
IF($proxsense < $proxclose)
SayEZB("Still to near")
EndIf
Sleep( 2000 )
goto(loop)
Has somebody an idea?
no,
The EZB only say the last one for "100"
$proxclose = 100
$proxsense = GetPing(D21,D22)
IF($proxsense < $proxclose)
SayEZB("Still to near")
For the "30" it never comes!
How i can make a command "between"?
It must be :
IF($proxsense is between 70 and 100)
but how to write it correct?
Boris
Code:
Code:
Rather than give you the fish I want you to learn to fish. So no code examples here! But you are looking at the IF statement command
Code:
And the ElseIf and Else commands.
Code:
Use different distance values and either the =, < or > for different actions. Use ControlCommand() to start other scripts, controls, autopositions etc.
And for between values, use the AND or the OR operator
Code: