Skip to content

Commit

Permalink
Harmonized code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelstuermer committed Oct 4, 2019
1 parent 31659c3 commit 7ec83bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,19 @@ After wiring it all together (as shown above), the code to let the LED blink wil
import time
import machine

SLEEP = 1.0

# Pin D1 is mapped to GPIO 5
ledPin = machine.Pin(5, machine.Pin.OUT)

while True:
ledPin.on()
print("LED is on")
time.sleep(2.0)
time.sleep(SLEEP)

ledPin.off()
print("LED is off")
time.sleep(2.0
time.sleep(SLEEP)
```

Once again, this results an a very predictable output (next to the LED behaving like a christmas tree): :christmas_tree:
Expand Down
6 changes: 4 additions & 2 deletions examples/led/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import machine

SLEEP = 1.0

# Pin D1 is mapped to GPIO 5
ledPin = machine.Pin(5, machine.Pin.OUT)

while True:
ledPin.on()
print("LED is on")
time.sleep(2.0)
time.sleep(SLEEP)

ledPin.off()
print("LED is off")
time.sleep(2.0)
time.sleep(SLEEP)

0 comments on commit 7ec83bb

Please sign in to comment.