Skip to content

Commit a163d14

Browse files
author
Richard Unger
committed
esp32 nano insists on 3 parameters for pulseIn
1 parent dbc28d4 commit a163d14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sensors/MagneticSensorPWM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ float MagneticSensorPWM::getSensorAngle(){
8585
int MagneticSensorPWM::getRawCount(){
8686
if (!is_interrupt_based){ // if it's not interrupt based read the value in a blocking way
8787
pulse_timestamp = _micros(); // ideally this should be done right at the rising edge of the pulse
88-
pulse_length_us = pulseIn(pinPWM, HIGH);
88+
pulse_length_us = pulseIn(pinPWM, HIGH, 1200); // 1200us timeout, should this be configurable?
8989
}
9090
return pulse_length_us;
9191
}

0 commit comments

Comments
 (0)