2018-07-28 18:42:27 +02:00
|
|
|
# Selectively setting readonly to False on boot
|
|
|
|
|
|
|
|
import board
|
|
|
|
import digitalio
|
|
|
|
import storage
|
2018-08-03 18:55:30 +02:00
|
|
|
|
2018-08-11 15:57:35 +02:00
|
|
|
jumper = digitalio.DigitalInOut(board.D5)
|
|
|
|
jumper.direction = digitalio.Direction.INPUT
|
|
|
|
jumper.pull = digitalio.Pull.UP
|
2018-07-28 18:42:27 +02:00
|
|
|
led = digitalio.DigitalInOut(board.D13)
|
|
|
|
led.direction = digitalio.Direction.OUTPUT
|
2018-08-03 18:55:30 +02:00
|
|
|
|
2018-09-09 11:36:54 +02:00
|
|
|
# If the jumper on D5 is connected
|
2018-07-28 18:42:27 +02:00
|
|
|
# CircuitPython can write to the drive
|
2018-08-11 15:57:35 +02:00
|
|
|
storage.remount("/", jumper.value)
|
|
|
|
led.value = jumper.value
|
|
|
|
print("Read-only:{}".format(jumper.value))
|