Skip to content

Commit 3fa0028

Browse files
add led example
Signed-off-by: Francois Berder <[email protected]>
1 parent 54f3c05 commit 3fa0028

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/led_example.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python3
2+
"""This example flashes all LED's 10 times."""
3+
4+
from letmecreate.core import led
5+
from time import sleep
6+
7+
8+
led.init()
9+
10+
for i in range(10):
11+
led.switch_on(led.ALL_LEDS)
12+
sleep(0.1) # Wait 100ms
13+
led.switch_off(led.ALL_LEDS)
14+
sleep(0.4) # Wait 400ms
15+
16+
led.release()

0 commit comments

Comments
 (0)