Asked — Edited

I Have A Tiny Question.

I'm going to make my rc car robot autonomous.

theres just one problem... It's an rc car! it has custom turn and drive scripts!

does anyone have an idea or example on how to make a script for radar? one that I can modify to accomidate my custom movements?


ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

#17  

just started working on a siren script that will use motion tracking and a soundboard.

I need a way to say: start motion tracking(with horizontal servo moving back and forth slowly) if motion detected start siren(track 1) wait 5 seconds. if no motion detected go back to motion tracking.

United Kingdom
#18  

ControlCommands will start those, check the control section of EZ-Script for the commands.

You will need to create a loop so it goes for 5 seconds, with sleeps and a sound the correct length or have the sound 5 seconds long since soundboard doesn't loop the sound.

To loop for 5 seconds you'll need a counter and an if;


# 5 second loop
$x = 0
:loop
IF ($x <= 5)
  $x = $x++
 Sleep(1000)
  Goto(loop)
EndIf

Depending on the sound, you may need to increase the condition of the if and reduce the sleep, say if $x <= 50 and sleep(100)

#19  

ok Ill look into it. EDIT: so what tells ARC to play a certain track?

#20  

Hi guys sorry to butt in but I have a question. I'm not very familiar with ARCs code yet but I do know programming in general so I have to ask, I see you declare $onlyforward as 0 and check it to see if it's 1 but I don't see where it ever gets set to 1. Is it being set in one of the scripts you're calling?

#21  

It's a good question. I'm twelve so I don't have very much programing knowledge.

If your saying that you declare $onlyforward as 0 and it changes to 1, that could be caused by another script. just my guess. also, it would be better to make a new post for your question because it doesn't directly relate to what me and rich are talking about.

Rich should be able to answer that

United Kingdom
#22  

At the top of the script in the config area. There are options for everything. Setting this to 1 here before running the script will make it check for forward movement before doing anything.

Quote:

Adjust values below for configuration

... $onlyforward = 0 # Only if moving forwards? 0 = no, 1 = yes

#23  

My question was about your code specifically. For some reason I was thinking that $onlyforward was saying to go only forward, not trigger the script only if it is moving forward. I was reading it wrong. Thanks for you answers. I'll let you guys get back to it. I hope you get it all worked out. :-)

#24  

is this right? i'm working on my ar drone and I made this script to warn me when the battery is at minimum point.


#Low Battery script

$DroneBatterymin=14

:start

IF($DroneBattery=$DroneBatterymin)
  Controlcommand(&quot;soundboard&quot;, Track_0)
ENDIF
Goto(start)