We'll start the program off by first importing the necessary libraries needed to make the program run. They can be imported because they lie in the CIRCUITPY drive in the folder "libraries" or "lib" as seen in a previous page of this guide. These libraries will allow us to analyze audio coming into the mic (audioio, audiobusio, and array), control the NeoPixel leds (neopixel), use the buttons (from digitalio import DigitalInOut, Direction, Pull, board), set times for how long we want the pitch to last (time) and perform various important math functions for calculating sound levels (math)!
import audiobusio import board import array import math import time from digitalio import DigitalInOut, Direction, Pull import audioio import neopixel
Page last edited March 08, 2024
Text editor powered by tinymce.