Cameteo/circuitpython/code/boot.py

17 lines
444 B
Python
Raw Normal View History

# Selectively setting readonly to False on boot
import board
import digitalio
import storage
2018-08-03 18:55:30 +02:00
switch = digitalio.DigitalInOut(board.D5)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
2018-08-03 18:55:30 +02:00
# If the D0 is connected to ground with a wire
# CircuitPython can write to the drive
storage.remount("/", switch.value)
2018-08-03 18:55:30 +02:00
led.value = switch.value