boot.py
1 # SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 # Save as boot.py to turn on/off datalogging capability 6 7 import digitalio 8 import board 9 import storage 10 11 switch = digitalio.DigitalInOut(board.D7) # For Circuit Playground Express 12 switch.direction = digitalio.Direction.INPUT 13 switch.pull = digitalio.Pull.UP 14 15 # If the switch pin is connected to ground CircuitPython can write to the drive 16 storage.remount("/", switch.value)