I try to make a loop with a dynamic intervaltime. I don't know how to fix this. Do someone have a suggestion for me?
var c = 1; var time = 15; function flash(time){ on = !on; digitalWrite(A0, on); c++; if(c >= 20){ digitalWrite(LED1, 1); } if(c >= 40){ digitalWrite(LED2, 1); } if(c >= 60){ digitalWrite(LED3, 1); } if(c >= 80){ c = 0; digitalWrite([LED1, LED2, LED3],0); time += 25; return time; } } setInterval(flash,time);
Thanks!
@Bert-Holland started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I try to make a loop with a dynamic intervaltime.
I don't know how to fix this.
Do someone have a suggestion for me?
Thanks!