A basic 2x2 matrix that can auto-flash to a Feather with a compatible bootloader
This commit is contained in:
22
kmk/circuitpython/util.py
Normal file
22
kmk/circuitpython/util.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import board
|
||||
import digitalio
|
||||
import time
|
||||
import sys
|
||||
|
||||
|
||||
def feather_signal_error_with_led_flash(rate=0.5):
|
||||
'''
|
||||
Flash the red LED for 10 seconds, alternating every $rate
|
||||
Could be useful as an uncaught exception handler later on,
|
||||
but is for now unused
|
||||
'''
|
||||
|
||||
rled = digitalio.DigitalInOut(board.LED1)
|
||||
rled.direction = digitalio.Direction.OUTPUT
|
||||
|
||||
# blink for 5 seconds and exit
|
||||
for cycle in range(10):
|
||||
rled.value = cycle % 2
|
||||
time.sleep(rate)
|
||||
|
||||
sys.exit(1)
|
Reference in New Issue
Block a user