Skip to content

Commit 15134d7

Browse files
bors[bot]rursprung
andauthored
Merge #568
568: `delay-syst-blinky` example: us `toggle` r=burrbull a=rursprung 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. Co-authored-by: Ralph Ursprung <[email protected]>
2 parents 840a9a5 + 6cb97b0 commit 15134d7

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)