From e31364b1725cd653446556540987034c995fa4a7 Mon Sep 17 00:00:00 2001 From: Wastl Kraus Date: Thu, 15 May 2025 13:00:35 +0200 Subject: [PATCH] Update dshot300.ino ...can't leave this alone ^^ --- examples/dshot300/dshot300.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/dshot300/dshot300.ino b/examples/dshot300/dshot300.ino index e32e9a0..671de5b 100644 --- a/examples/dshot300/dshot300.ino +++ b/examples/dshot300/dshot300.ino @@ -38,13 +38,11 @@ void loop() // Read the throttle value from the USB serial input int throttle_input = read_SerialThrottle(); - // Set the throttle value to either the value received from the serial input or the failsafe throttle value - auto throttle_value = (throttle_input > 0) ? throttle_input : FAILSAFE_THROTTLE; - // Send the throttle value to the motor - motor01.sendThrottleValue(throttle_value); + motor01.sendThrottleValue(throttle_input); } +// ...just for this example // Read the throttle value from the USB serial input int read_SerialThrottle() { @@ -53,4 +51,8 @@ int read_SerialThrottle() auto throttle_input = (USB_Serial.readStringUntil('\n')).toInt(); return throttle_input; } + else + { + return FAILSAFE_THROTTLE; + } }