Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe Teensy 4.0 can act as a USB MIDI device, so your computer sees it as a music controller. Four potentiometers send control-change messages that you can map to volume, filters or effects in a DAW.
Teensy 4.0 inputs are 3.3 V only.
Tick anything you already have and the total updates.
Alternative board: USB MIDI from CircuitPython
Follow the colours: red is power, dark grey is ground, blue is a signal.
midi_knobs.ino// Tools > USB Type: MIDI. Knobs send CC 20-23 on channel 1.
const int PINS[4] = {A0, A1, A2, A3};
const int CC[4] = {20, 21, 22, 23};
int last[4] = {-1, -1, -1, -1};
void setup() {}
void loop() {
for (int i = 0; i < 4; i++) {
int v = analogRead(PINS[i]) >> 3; // 0-1023 -> 0-127
if (abs(v - last[i]) > 1) { // ignore 1-step jitter
usbMIDI.sendControlChange(CC[i], v, 1);
last[i] = v;
}
}
while (usbMIDI.read()) {} // discard incoming messages
delay(5);
}
USB Type must be MIDI before upload; use a data USB cable.
Check the pot outer pins go to 3.3 V and GND, and keep wires short.
One outer pin is not connected.
Yes, send noteOn and noteOff with usbMIDI.
No, it is a standard USB MIDI device.
Power them from 3.3 V; the Teensy 4.0 pins are not 5 V tolerant.
6 parts: Teensy 4.0 Dev Board with Pre-Soldered Headers, 4 × 16mm Rotary Potentiometer (Linear), USB-A to Micro USB-B Cable 100cm, Solderless Breadboard, Dupont Jumper Wires (40 pcs) and Adafruit Feather M0 Express – ATSAMD21 Cortex-M0. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 2 hours. The build on this page has 4 steps.
No. This page has the complete, tested code (midi_knobs.ino).
About ₹5,494 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
USB device classes (MIDI); Reading and smoothing analog inputs; MIDI control-change messages.
Teensy 4.0 inputs are 3.3 V only.
Ideas that reuse this build: UNO R4 WiFi message board. They are listed under Take it further on this page.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Learning project. Check every circuit and the datasheet of each part before you power it up.