In brief im trying to achieve as follows- RELAY ONE (ON 10 SECONDS OF 10 SECONDS) RELAY TWO (ON 10 SECONDS OF 10 SECONDS) RELAY TWO TO START AS RELAY ONE STOPS AND AS RELAY TWO STOPS RELAY ONE TO START (LOOP)
Im not expecting anyone to write a whole programme for me but im eager to start learning and have idea where to start.
Hi
Im very sorry , its a bad habit of mine when im trying to say something complicated quickly and clearly so it is easy to read and it allows me to miss out can miss out punctuation.
im most certainly not shouting but i am getting really frustrated as i can find no parameters or starting/reference points to start learning code
sorry for any offence caused im really just trying to learn something new and it really isnt easy but i will keep trying even if it kills me
In brief im trying to achieve as follows- RELAY ONE (ON 10 SECONDS OF 10 SECONDS) RELAY TWO (ON 10 SECONDS OF 10 SECONDS) RELAY TWO TO START AS RELAY ONE STOPS AND RELAY TWO STOPS AS RELAY ONE STARTs (LOOP) (Caps lock for clarity)
I imagine it will be something like two blink sketches with something complicated in the middle. :O)
Im not expecting anyone to write a whole programme for me but im eager to start learning and have idea where to start.
You seem to be aware of BlinkWithoutDelay so, using that principle
define output pins and modes
define the switching interval
turn on relay1
set flag to indicate that relay1 is on
set start time to millis
start of loop
if it is time to swap relays //millis() - start time > interval
if relay1 is off
output HIGH to relayPin1
output LOW ro relayPin2
set flag to indicate relay1 is on
end of if
else
output LOW to relayPin1
output HIGH ro relayPin2
set flag to indicate relay1 is off
end of else
set start time to millis
end of if
end of loop
MIG18WOW:
Im very sorry , its a bad habit of mine when im trying to say something complicated quickly and clearly so it is easy to read and it allows me to miss out can miss out punctuation.
Start one more thread about this and I will delete all of them and your account.
No good saying "sorry" if you keep doing it. I'll be sorry too.
Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.
What your asking for is just a slight derivative of the "blink" example provided in the IDE.
I've gone ahead and written something for you that should work. Note, that I don't have my Arduino next to me to test this. So hopefully I left a few little bugs for you to work out.
Now, you mention using this to drive relays...you might want to list the specs on your relays. The Arduino can't operate relays outside its voltage/power range.