From 009f3b9629975d1e049f9ec17ecc090b60c6dc24 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Fri, 30 Aug 2024 14:33:42 +0200 Subject: [PATCH] fix map from microseconds to angle in Servo::read --- src/renesas/Servo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renesas/Servo.cpp b/src/renesas/Servo.cpp index fba4210..62926f8 100644 --- a/src/renesas/Servo.cpp +++ b/src/renesas/Servo.cpp @@ -245,7 +245,7 @@ int Servo::read() { if (servoIndex != SERVO_INVALID_INDEX) { ra_servo_t *servo = &ra_servos[servoIndex]; - return map(servo->period_us, servo->period_min, servo->period_max, 0, 180); + return map(servo->period_us + 1, servo->period_min, servo->period_max, 0, 180); } return 0; }