Asked

Script For The Radar And Ezbv4 Sound

hi

i wrote a script for using the radar ( ping sensor ) . my problem is i think i need a loop , in the script but then its keeps saying over and over desame words .

controlCommand("Ultrasonic Radar Scan", "PauseOff") sleep(400) ping_Wait(d5,d5,higher,50) sleep(400) sayezb(" intruder detected ") sleep(300) controlCommand("Auto Position", "AutoPositionAction", "Wah")

my second queqtion is .

will it be possible in the future to change the start up shime from the ezbv4? incase i asked this question before . my appolegies .


ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

#1   — Edited

I've never used the Ping command but I think you need to have two different ports listed in it. In your example you have the same port, d5, listed twice.

ping_Wait(d5,d5,higher,50)

Quote:

Trigger and Echo are Digital Ports
Other then that, when you are looping the script are you moving the object out of the range you state once it's detected? If not that could cause the script to say the same phrase you want it to when the object is still in range.

Also once the object is detected within range you should probably have the script wait until the object is out of range again.

Again, I've never played with ping sensors and their scripts so these are just guesses.

PRO
Synthiam
#2  

Some ping sensors use a single wire and therefore use the same port. So that’s fine

i think you’re using the wrong ping wait command. You’re waiting until the value is higher than 50. That means when no one is there it continues.

I think you want ping wait lower

PRO
Belgium
#3  

hi dj

ah i have a try . am using the orginal from ez robot with 3 wire .

hi dave

the 3 wire ultra sonic uses same ports

thank you bolt .

#4   — Edited

I think the issue is what DJ said, with the value set to higher than 50 as it is scripted if would take action if the distance was further away or nothing detected.  The lower the value, the closer the object is with PING sensors, right?

And if you wanted everything to constantly run in the script without end you would want to use a loop.  Otherwise, it would run once.

PRO
Belgium
#5  

hi justin

that is correct . i wanna the robot to react when the ping detects something.

thanks

#6  

Can you hear my Boxer dog snoring in the background, LOL

This might help:

controlCommand("Ultrasonic Radar Scan", "PauseOff")
Goto(IntruderDetected)

:IntruderDetected
sleep(400)
ping_Wait(d11,d11,lower,50)
sleep(400)
sayezb(" intruder detected ")
sleep(300)
#controlCommand("Auto Position", "AutoPositionAction", "Wah")
ControlCommand("Auto Position", AutoPositionAction, "Gunready")
ControlCommand("RGB Animator", AutoPositionAction, "Scanner")
ControlCommand("RGB Animator2", AutoPositionAction, "Police2")
sleep(8000)
Goto(AllClear)
Return()

:AllClear
ping_Wait(d11,d11,higher,50)
sleep(400)
ControlCommand("Auto Position", AutoPositionAction, "Stand")
ControlCommand("RGB Animator", AutoPositionAction, "RedEyes2")
ControlCommand("RGB Animator2", AutoPositionAction, "B9ChestLights")
sleep(400)
Goto(IntruderDetected)
Return() 
PRO
Belgium
#7  

hi justin

that is awesome thank you . i love how smooth your robot is . i cant hear the dog cause am a little deaf on bolt sides .lol

#9  

That is awesome Nomad.  Your mini JD is so freaking cute!!