We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4eebd9 commit 983cc29Copy full SHA for 983cc29
1 file changed
src/sensor.cpp
@@ -253,7 +253,9 @@ void HCSR04SensorManager::sendTriggerToSensor(uint8_t sensorId) {
253
sensor->end = MEASUREMENT_IN_PROGRESS; // will be updated with LOW signal
254
sensor->numberOfTriggers++;
255
sensor->measurementRead = false;
256
- sensor->trigger = sensor->start = micros(); // will be updated with HIGH signal
+ const uint32_t now = micros();
257
+ sensor->trigger = now; // will be updated with HIGH signal
258
+ sensor->start = now;
259
digitalWrite(sensor->triggerPin, HIGH);
260
// 10us are specified but some sensors are more stable with 20us according
261
// to internet reports
0 commit comments