-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bastian Baumeister
committed
Nov 1, 2021
1 parent
22792ed
commit b7a7436
Showing
5 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import machine | ||
|
||
class Watchdog: | ||
def __init__(self, active=True): | ||
self._active=active | ||
if (self._active): | ||
self._watchdog = machine.WDT() | ||
|
||
def feed(self): | ||
if (self._active): | ||
self._watchdog.feed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import machine | ||
import time | ||
|
||
led = machine.Pin(2, machine.Pin.OUT) | ||
|
||
def blink(times = 3, duration = 0.25): | ||
for _ in range(times): | ||
led.off() | ||
time.sleep(duration) | ||
led.on() | ||
time.sleep(duration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters