19 lines
596 B
Python
19 lines
596 B
Python
"""CircuitPython Essentials Storage logging boot.py file"""
|
|
import board
|
|
import digitalio
|
|
import storage
|
|
|
|
# For Gemma M0, Trinket M0, Metro M0/M4 Express, ItsyBitsy M0/M4 Express
|
|
switch = digitalio.DigitalInOut(board.D2)
|
|
|
|
# For Feather M0/M4 Express
|
|
# switch = digitalio.DigitalInOut(board.D5)
|
|
|
|
# For Circuit Playground Express, Circuit Playground Bluefruit
|
|
# switch = digitalio.DigitalInOut(board.D7)
|
|
|
|
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)
|