From 2b535eceb604ea23a893cbfe9f34fb2aa473e663 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Thu, 21 Dec 2023 16:53:11 +0000 Subject: [PATCH] Simplify pwm_blink examples --- rp2040-hal/examples/pwm_blink.rs | 4 ++-- rp2040-hal/examples/pwm_blink_embedded_hal_1.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rp2040-hal/examples/pwm_blink.rs b/rp2040-hal/examples/pwm_blink.rs index 3572da98d..dc1b77e49 100644 --- a/rp2040-hal/examples/pwm_blink.rs +++ b/rp2040-hal/examples/pwm_blink.rs @@ -104,13 +104,13 @@ fn main() -> ! { // Infinite loop, fading LED up and down loop { // Ramp brightness up - for i in (LOW..=HIGH).skip(100) { + for i in LOW..=HIGH { delay.delay_us(8); channel.set_duty(i); } // Ramp brightness down - for i in (LOW..=HIGH).rev().skip(100) { + for i in (LOW..=HIGH).rev() { delay.delay_us(8); channel.set_duty(i); } diff --git a/rp2040-hal/examples/pwm_blink_embedded_hal_1.rs b/rp2040-hal/examples/pwm_blink_embedded_hal_1.rs index 02e2e240b..c1b537d44 100644 --- a/rp2040-hal/examples/pwm_blink_embedded_hal_1.rs +++ b/rp2040-hal/examples/pwm_blink_embedded_hal_1.rs @@ -104,13 +104,13 @@ fn main() -> ! { // Infinite loop, fading LED up and down loop { // Ramp brightness up - for i in (LOW..=HIGH).skip(100) { + for i in LOW..=HIGH { delay.delay_us(8); channel.set_duty_cycle(i).unwrap(); } // Ramp brightness down - for i in (LOW..=HIGH).rev().skip(100) { + for i in (LOW..=HIGH).rev() { delay.delay_us(8); channel.set_duty_cycle(i).unwrap(); }