12 lines
283 B
Python
12 lines
283 B
Python
import board
|
|
import digitalio
|
|
import storage
|
|
|
|
switch = digitalio.DigitalInOut(board.GP4)
|
|
|
|
switch.direction = digitalio.Direction.INPUT
|
|
switch.pull = digitalio.Pull.UP
|
|
|
|
# If the switch pin is connected to ground CircuitPython can write to the drive
|
|
storage.remount("/", switch.value)
|