Asked
— Edited
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?
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.
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;
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)
ok Ill look into it. EDIT: so what tells ARC to play a certain track?
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?
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
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.
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. :-)
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.