Skip to content

Instantly share code, notes, and snippets.

@FaliqCytron
Created May 20, 2024 01:53
Show Gist options
  • Select an option

  • Save FaliqCytron/87e0a35b6f82fd0d66d0e11968dea800 to your computer and use it in GitHub Desktop.

Select an option

Save FaliqCytron/87e0a35b6f82fd0d66d0e11968dea800 to your computer and use it in GitHub Desktop.
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
boot.py file for Pico data logging example. If pin GP0 is connected to GND when
the pico starts up, make the filesystem writeable by CircuitPython.
"""
import board
import digitalio
import storage
write_pin = digitalio.DigitalInOut(board.GP15)
write_pin.direction = digitalio.Direction.INPUT
write_pin.pull = digitalio.Pull.UP
# If write pin is connected to ground on start-up, CircuitPython can write to CIRCUITPY filesystem.
if not write_pin.value:
storage.remount("/", readonly=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment