Society of Robots - Robot Forum
Software => Software => Topic started by: keithg on April 19, 2009, 05:15:54 AM
-
My elementary gifted students are designing an Arduino/EZ ultrasound robot that must stop after eight seconds. Brandon Sweeney' s sketch is working well but the timing code is beyond us. Is there a simple method? His code is here: http://pastie.org/451287 (http://pastie.org/451287)
-
what do you mean by the timing code? is it a specific part of the code?
-
to delay a part of code for 8 seconds do this
delay(8000);
If you could be more specific it will be nice.
-
If you would like to stop after 8 seconds, you could put this at the end of the setup loop:
if(millis() >= 8000)
{
while(1)
{
}
}
-
I have pasted the code here: http://pastie.org/451511 (http://pastie.org/451511) Having so little experience, I borrowed from several sources. The motors need to stop and await manual restart by student players. Thanks for the help. We need it!