Congratulations Richard R, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

How To Time Sendserial Command

Assistance Requested

Help Jayutmb with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Jayutmb claims to have checked these sources:

Ok... So I have a quick scripting question... I have two motor controllers in my project, and one is used up with the Movement Panel and the other I use send serial commands to control. Issue is how to write script to control duration of movement of the second ? I know for my movement controls I can script something like Forward(XXXX,XXX) and that will do it... However, I dont know how to script the sendserial command to the same since I cant use the same method as it is not linked to the Movement Panel..

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.

Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


The below will run the motor for 5 seconds then stop


sendSerial(D0,38400,127) #motor full speed
sleep(5000) #run motor for 5 seconds or for as long as you need
Sendserial(D0,38400,0) # stop the motor


Thx sir Smile
I was thinking about using the sleep command, but i thought it would just stop the whole thing all together after a fast twitch of the motor *blush*