A basic 2x2 matrix that can auto-flash to a Feather with a compatible bootloader

This commit is contained in:
Josh Klar
2018-09-02 20:06:53 -07:00
parent 6de723c376
commit e9d448af44
17 changed files with 303 additions and 0 deletions

22
kmk/circuitpython/util.py Normal file
View 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)