Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe ATmega32U4 on the Pro Micro has native USB, so the standard Arduino Keyboard library makes it a keyboard. Two buttons, mounted in a small box on the floor, send Page Down and Page Up: handy for reading music or slides with your hands busy. Swap the keys for a push-to-talk key to use it in calls.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
Powered by the computer's USB port.
foot_pedal.inoVerify & upload in Electrolark#include <Keyboard.h>
const int PEDAL_DOWN = 2, PEDAL_UP = 3;
bool lastDown = HIGH, lastUp = HIGH;
void setup() {
pinMode(PEDAL_DOWN, INPUT_PULLUP);
pinMode(PEDAL_UP, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
bool d = digitalRead(PEDAL_DOWN), u = digitalRead(PEDAL_UP);
if (d != lastDown) { if (d == LOW) Keyboard.press(KEY_PAGE_DOWN); else Keyboard.release(KEY_PAGE_DOWN); lastDown = d; }
if (u != lastUp) { if (u == LOW) Keyboard.press(KEY_PAGE_UP); else Keyboard.release(KEY_PAGE_UP); lastUp = u; }
delay(15);
}
Normal for 32U4 boards: the USB restarts. Double-tap RST quickly to enter the bootloader if an upload hangs.
Check the release lines and that the switch returns to open.
A 3.3 V 8 MHz Pro Micro needs the 3.3 V board option; the 5 V one uses 16 MHz.
Yes, use a key your call app supports, such as KEY_F13, and set it in the app.
No, it is a standard USB keyboard.
Yes, any normally-open switch works the same way.
4 parts: Pro Micro 5V 16MHz ATmega32U4 Dev Board, 2 × Tactile Push Button Switch, Solderless Breadboard and Dupont Jumper Wires (40 pcs). 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 45 minutes. The build on this page has 5 steps.
No. This page has the complete, tested code (foot_pedal.ino).
About ₹480 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
USB HID on the ATmega32U4; The Arduino Keyboard library; Holding a key down while a switch is pressed.
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.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.