Timeline for Managing 2 ultrasonic sensors without blocking the other
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 10, 2017 at 9:39 | comment | added | andrew |
what does static uint32_t millis_next = 0; do exactly? (I'm new to C++/Arduino)
|
|
Apr 10, 2017 at 5:42 | comment | added | James Waldby - jwpat7 |
The millis_next += INTERVAL_SENSOR1; ... if (millis() >= millis_next)... method miscomputes when millis() overflows. To avoid that, instead write millis_prev = millis(); (or perhaps millis_prev += INTERVAL_SENSOR1; ) and then test via if (millis()-millis_prev > INTERVAL_SENSOR1)...
|
|
Apr 9, 2017 at 23:24 | history | answered | dannyf | CC BY-SA 3.0 |