Skip to content

Commit 6cb97b0

Browse files
committed
delay-syst-blinky example: us toggle
as the on & off periods are the same and it doesn't matter what the initial state is we can just use `toggle` instead of `set_high` and `set_low`. the latter is still present in other examples, e.g. `delay-timer-blinky` which uses different delays for the on & off periods.
1 parent 840a9a5 commit 6cb97b0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/delay-syst-blinky.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ fn main() -> ! {
3232

3333
loop {
3434
// On for 1s, off for 1s.
35-
led.set_high();
36-
delay.delay_ms(1000_u32);
37-
led.set_low();
35+
led.toggle();
3836
delay.delay_ms(1000_u32);
3937
}
4038
}

0 commit comments

Comments
 (0)