Skip to content

Commit fbb7875

Browse files
committed
use the min_raw_count in PWM sensor getRawCount
1 parent 925a1e4 commit fbb7875

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
@@ -35,7 +35,7 @@ void MagneticSensorPWM::init(){
3535
float MagneticSensorPWM::getSensorAngle(){
3636
// raw data from sensor
3737
raw_count = getRawCount();
38-
return( (float) (raw_count) / (float)cpr) * _2PI;
38+
return( (float) (raw_count - min_raw_count) / (float)cpr) * _2PI;
3939
}
4040

4141

0 commit comments

Comments
 (0)