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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
283 B
Python
Raw Normal View History

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