Friday, 15 May 2015

loops - Arduino interupt a delay function -



loops - Arduino interupt a delay function -

in next project utilize 4 leds delay(10000). need function cancel loop , start 1 time again new delay value e.g. 100.

i have enabled interrupts , when pressed button, delay changed 100 after round. have wait 10 seconds.. possible restart loop function new values?

wow rude ignacio @ to the lowest degree helpful.

you can not have implemented.

delay not used in circumstance. much improve way of implementing utilize while loop this:

int delayled = 10000; int beginmillis = millis(); while( millis() - beginmillis < delayled) { // insert code "interrupt" here // kinda if(button pressed) { delayled = 100; break; } }

this template not finish answer. allow me know if have farther questions.

happy coding!

loops arduino interrupt led

No comments:

Post a Comment