Society of Robots - Robot Forum
|
Robot Tutorials
|
FAQ
|
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Squirrels have fuzzy tails.
Home
Help
Search
Login
Register
Society of Robots - Robot Forum
»
Software
»
Software
»
Arduino loop exit - Brandon Sweeney's sketch
Print
Author
Topic: Arduino loop exit - Brandon Sweeney's sketch (Read 10171 times)
0 Members and 1 Guest are viewing this topic.
keithg
Beginner
Posts: 2
Helpful? 0
Arduino loop exit - Brandon Sweeney's sketch
«
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
Logged
SmAsH
Supreme Robot
Posts: 3,959
Helpful? 75
SoR's Locale Electronics Nut.
Re: Arduino loop exit - Brandon Sweeney's sketch
«
Reply #1 on:
April 19, 2009, 05:24:39 AM »
what do you mean by the timing code? is it a specific part of the code?
Logged
Howdy
offy
Supreme Robot
Posts: 340
Helpful? 1
Re: Arduino loop exit - Brandon Sweeney's sketch
«
Reply #2 on:
April 19, 2009, 10:02:00 AM »
to delay a part of code for 8 seconds do this
delay(8000);
If you could be more specific it will be nice.
Logged
Razor Concepts
Supreme Robot
Posts: 1,856
Helpful? 53
Re: Arduino loop exit - Brandon Sweeney's sketch
«
Reply #3 on:
April 19, 2009, 10:18:54 AM »
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)
{
}
}
Logged
www.razorconcepts.net
keithg
Beginner
Posts: 2
Helpful? 0
Re: Arduino loop exit - Brandon Sweeney's sketch
«
Reply #4 on:
April 19, 2009, 11:01:50 AM »
I have pasted the code here:
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!
Logged
Print
Society of Robots - Robot Forum
»
Software
»
Software
»
Arduino loop exit - Brandon Sweeney's sketch