Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Created February 21, 2022 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baskaufs/7690e84ae5869b0b1a79e09053a83663 to your computer and use it in GitHub Desktop.
Save baskaufs/7690e84ae5869b0b1a79e09053a83663 to your computer and use it in GitHub Desktop.
boot script for switch-based control of QT Py RP2040 memory read/write
import board
import digitalio
import storage
switch = digitalio.DigitalInOut(board.D0)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
# Connecting D0 to ground makes switch.value False
storage.remount("/", switch.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment