Asked — Edited
Resolved Resolved by Dunning-Kruger!

Interaction Between Vocal Command And Running Script?

Is it possible to interact vocal commands into a running script? For example..... My robot at this point is only a lower half using serial commands for movement via script. The way it works is via timing that I have set up using the sleep command. However for whatever reason the robot does not always track the same way every time. This causes the robot to crash into things. This is still just a testing phase, there is no sensor feedback as I am awaiting my second ezb for that. I would like to be able to say "STOP" when it starts to track incorrectly and start heading towards a wall. My script for example is something llike this...

Sendserial(d0,38400,255) Sendserial(d0,38400,127) Sleep(3000) Sendserial(do,38400,255) Sendserial(d0,38400,10) - This line causes a differential in the tracks causing it to turn.

etc etc.

Now where would I insert the Stop command? Would it be after every sleep command so after every running portion of the script it would STOP upon command? So would I need to insert multiple STOP commands in the script. Thanks for the help, always appreciated.

                                                                                Chris

ARC Pro

Upgrade to ARC Pro

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

United Kingdom
#9  

edited while you replied. See above.

With serial commands you would need to send the stop command via sendserial. Depending on the device will depend on the command.

#10  

Sop then...

Stop() Sendserial (D0,38400,xxx) SendSerial(D0,38400,xxx)

should do it?

#11  

Yep, your above code will work as an emergency stop... or

Stop() # works with movement panel SendSerial(D0,38400,0) # will stop both motors