Skip to content

circuitpython

"The easiest way to program microcontrollers. CircuitPython is a programming language designed to simplify experimenting and learning to code on low-cost microcontroller boards. " - https://circuitpython.org

Examples

Disable CIRCUITPYTHON usb drive

Create a boot.py file in the drive with the following contents:

import storage

storage.disable_usb_drive()

To re-enable the drive, use the serial console to access the repl and comment out all of the contents of boot.py by running:

import storage

with open('boot.py', mode='r') as f:
    contents = [f'#{x}' for x in f.readlines()]

with open('boot.py', mode='w') as f:
    f.write(''.join(contents))

or just delete the boot.py file with:

import os, storage
storage.remount('/', readonly=False)
os.remove('/boot.py')

See also