Skip to content

Commit 8f3bdc7

Browse files
committed
Fix blink example
1 parent 1261e43 commit 8f3bdc7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ use rust_gpiozero::*;
2222
fn main() {
2323
// Create a new LED attached to Pin 17
2424
let mut led = LED::new(17);
25-
// blink the LED
26-
led.blink(2.0, 3.0);
25+
26+
// on_time = 2 secs, off_time=3 secs
27+
led.blink(2.0,3.0);
28+
29+
// prevent program from exiting immediately
30+
led.wait();
2731
}
2832

2933
```

examples/blink.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ use rust_gpiozero::*;
55
fn main() {
66
// Create a new LED attached to Pin 17
77
let mut led = LED::new(17);
8-
// blink the LED
9-
led.blink(2.0, 3.0);
8+
9+
// on_time = 2 secs, off_time=3 secs
10+
led.blink(2.0,3.0);
11+
12+
// prevent program from exiting immediately
13+
led.wait();
1014
}

0 commit comments

Comments
 (0)