circuitpython/tests/circuitpython-manual/alarm/esp/boot.py

12 lines
284 B
Python
Raw Normal View History

2021-06-20 18:09:18 -04:00
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)