From b4cb24c7356c0c655fa15bf6996ddbe383df8707 Mon Sep 17 00:00:00 2001 From: Jacob Rosenthal Date: Thu, 11 Nov 2021 23:32:34 -0700 Subject: [PATCH] pwm_servo example comment for clarity --- examples/nrf/src/bin/pwm_servo.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/nrf/src/bin/pwm_servo.rs b/examples/nrf/src/bin/pwm_servo.rs index 700b8857..7859a858 100644 --- a/examples/nrf/src/bin/pwm_servo.rs +++ b/examples/nrf/src/bin/pwm_servo.rs @@ -26,6 +26,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { // 1ms 0deg (1/.008=125), 1.5ms 90deg (1.5/.008=187.5), 2ms 180deg (2/.008=250), loop { info!("45 deg"); + // poor mans inverting, subtract our value from max_duty pwm.set_duty(0, 2500 - 156); Timer::after(Duration::from_millis(5000)).await;