Timeline for A problem with measuring time in a for loop
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 3, 2020 at 2:47 | review | Suggested edits | |||
| Jan 3, 2020 at 4:30 | |||||
| Jan 2, 2020 at 12:54 | comment | added | Andrija Erovic | I have tried that. I added a counter that counts how many times those two values match. And then, in my IF I added that whenever the newTime-oldTime >= dt && i<counter it should turn the LED off, and increment i by 1 (i++) , but it still behaves the same. For some reason it looks like it only recognizes the first iteration of the for loop | |
| Jan 2, 2020 at 11:14 | comment | added | Juraj♦ | you want to lit the LED for 2 seconds so many times how many values match? then count the matches first and then do the blinking | |
| Jan 2, 2020 at 11:08 | vote | accept | Andrija Erovic | ||
| Jan 2, 2020 at 10:59 | comment | added | Andrija Erovic | Now it works, the LED turns on for 2 seconds, and then turns off. But only for the first iteration, it works for the first value form the array, when comparing to the other values it behaves the same as before | |
| Jan 2, 2020 at 10:32 | history | answered | Juraj♦ | CC BY-SA 4.0 |