Install CircuitPython
The Adafruit Feather M4 ships with CircuitPython but lets go ahead and update it to the latest version. It's super easy with the circuitpython.org website, just click the link below to launch the page. There you can choose to install stable release or beta.
Quick Start
- Connect board to computer via a known good USB and double press the reset button.
- Download the CircuitPython UF2 and upload to the FEATHERBOOT drive.
- Open CIRCUITPY drive and upload the required libraries (listed below) and code.py
Adafruit Circuit Python Libraries
Download the CircuitPython library bundle and unzip the folder. Create a new folder in the CIRCUITPY drive and name it "lib". The following libraries are required to run the code properly. Double check to ensure all of the files and folders are inside the lib folder on the CIRCUITPY drive.
- adafruit_bus_device (directory)
- adafruit_lis3dh.mpy
- neopixel.mpy
- adafruit_rgbled.py
- simpleio.mpy
Upload code.py
Click the link below to download the project code. Save it as code.py on your CIRCUITPY drive.
# SPDX-FileCopyrightText: 2019 Erin St Blaine for Adafruit Industries # # SPDX-License-Identifier: MIT import time import board from rainbowio import colorwheel import adafruit_rgbled import digitalio POWER_PIN = board.D10 enable = digitalio.DigitalInOut(POWER_PIN) enable.direction = digitalio.Direction.OUTPUT enable.value = True # Pin the Red LED is connected to RED_LED = board.D11 # Pin the Green LED is connected to GREEN_LED = board.D12 # Pin the Blue LED is connected to BLUE_LED = board.D13 # Create the RGB LED object led = adafruit_rgbled.RGBLED(RED_LED, GREEN_LED, BLUE_LED) # Optionally, you can also create the RGB LED object with inverted PWM # led = adafruit_rgbled.RGBLED(RED_LED, GREEN_LED, BLUE_LED, invert_pwm=True) def rainbow_cycle(wait): for i in range(255): i = (i + 1) % 256 led.color = colorwheel(i) time.sleep(wait) while True: # rainbow cycle the RGB LED rainbow_cycle(0.1)
Troubleshooting
If it's not working, make double-sure you have all the above libraries installed in your "lib" folder. Also be sure all your wire connections are tight and the wires are connected up correctly.
More about CircuitPython can be found here!
Important Note about Power!!
Do NOT leave the battery pack plugged in to the Feather while you also have a USB cord plugged in. The Feather has onboard charging, so it will try to charge your AA batteries, which could result in battery damage and / or Feather damage.
Page last edited February 25, 2025
Text editor powered by tinymce.