boot.py
 1  # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
 2  # SPDX-License-Identifier: MIT
 3  """
 4  CircuitPython Essentials Storage CP Filesystem boot.py file
 5  """
 6  import time
 7  import board
 8  import digitalio
 9  import storage
10  import neopixel
11  
12  pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
13  
14  button = digitalio.DigitalInOut(board.BUTTON)
15  button.switch_to_input(pull=digitalio.Pull.UP)
16  
17  # Turn the NeoPixel white for one second to indicate when to press the boot button.
18  pixel.fill((255, 255, 255))
19  time.sleep(1)
20  
21  # If the button is connected to ground, the filesystem is writable by CircuitPython
22  storage.remount("/", readonly=button.value)