circuitpython/tests/circuitpython-manual/alarm/esp/boot.py
2021-06-20 18:09:18 -04:00

12 lines
284 B
Python

import board
import digitalio
import storage
switch = digitalio.DigitalInOut(board.IO10)
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)