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

This guide was first published on Mar 28, 2018. It was last updated on Mar 08, 2024.

This page (Importing Libraries) was last updated on Mar 08, 2024.

Text editor powered by tinymce.