Asked — Edited

Script Help, Doing More Than One Thing At Once

Hey everyone,

Project has 3 Hbridges (robo claw). All controlled serially example...

Sendserial(d0,38400,125)# lft track forward 1 sec sleep(1000)

What I would like to do is while moving forward I would like its body controlled H-bridge to start moving body up so that full body extend will be in process before machine reaches kitchen.

Ive tried something like...

Sendserial(do,38400,125) , Sendserial (d1,38400,70)

But obviously it doesn't work. Im sure its something using control command.... but I haven't got my head wrapped around the whole ControlCommand() thing yet. Thanks in advance.

                  Chris


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

United Kingdom
#1  

Put it on two lines not one.


Sendserial (d0,38400,125)
Sendserial (d1,38400,70)

#2  

You can either run one command after another in the same script (with sleep delays as needed) or run multiple scripts at once.... ARC is pretty much multi-tasking...


Sendserial(d0,38400,125)# lft track forward 1 sec
sleep(1000)
Sendserial (d1,38400,70) #now send commands to the 2nd roboclaw

#3  

@Rich_the_time_traveller beat me to it again.... :P

#4  

Thanks guys, I may have been misleading though. So I guess what I'm after is start body up 4 seconds into an 8 second travel time with travel time meaning 8 seconds for machine to get from my family room to my kitchen. So maybe something like when sleep equals greater than or equal to 4000 body start lifting and continue lifting during travel.

United Kingdom
#5  

Sendserial (d0,38400,125) # Start moving
Sleep(4000) # Wait 4 seconds
Sendserial (d1,38400,70) # Raise body

The robot will continue moving during a sleep. The sleep just delays the next line for however many ms is specified.

#6  

Ok I see, but what stops main movement at the 8 second mark?

Not to be too much of a bother but can someone provide an example using control commands to? All of my scripting can't be done serially over time (sleep command) once o figure that command out I think I will be golden.

#7  

My script has sleep (8000) following main movement command and then serial stop command for both tracks.

PRO
Synthiam
#8  

Perhaps you are unaware that you can add more than one line of EZ-Script? Press the little PENCIL icon beside the EZ-Script edit box and it will open a window or you to enter multiple lines of code.

As for using the CONTROL COMMAND, there is a tab labelled Cheat Sheet when editing a script. I can see from your profile that you have taken the EZ-Script lesson. I feel it would help if you read the EZ-Script lesson a second time.

#9  

Whenever you are ready to stop both motors (even at different times) use a variant of the code below... remember you can have as many lines in a script as you wish.... Use each line as a flow of events so to speak... start one motor... wait, start another motor, wait some more, stop the first motor, wait, stop the second.... done



Sendserial (d0,38400,0) # Stop motor controller1

sleep(4000) #stop motor controller number 2... 4 seconds later

Sendserial (d1,38400,0 # stop motor controller number 2


Use the sleep commands to control when the motors start and stop :)