Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsMost ESP32 boards talk to the computer through a USB-serial chip, but the ESP32-S3 has USB built into the chip. With the 'USB' port of the DevKitC and the USBHIDKeyboard library from the Arduino ESP32 core, the board shows up as a keyboard with no driver. Four buttons send shortcut keys; change them to anything you use often.
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.
macro_keypad.inoVerify & upload in Electrolark#include "USB.h"
#include "USBHIDKeyboard.h"
USBHIDKeyboard Keyboard;
const int PINS[4] = {4, 5, 6, 7};
const char KEYS[4] = {'c', 'v', 'z', 's'}; // Ctrl+C, Ctrl+V, Ctrl+Z, Ctrl+S
bool last[4] = {true, true, true, true};
void setup() {
for (int i = 0; i < 4; i++) pinMode(PINS[i], INPUT_PULLUP);
Keyboard.begin();
USB.begin();
}
void loop() {
for (int i = 0; i < 4; i++) {
bool now = digitalRead(PINS[i]);
if (last[i] && !now) { // pressed
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEYS[i]);
delay(20);
Keyboard.releaseAll();
}
last[i] = now;
}
delay(10);
}
Use the port marked USB, and set USB Mode to USB-OTG (TinyUSB) before uploading.
Hold BOOT, tap RESET, release BOOT, then upload again.
Increase the 10 ms loop delay to debounce better.
Yes; use KEY_LEFT_GUI instead of KEY_LEFT_CTRL for Command shortcuts.
Yes, any free GPIO works; extend the two arrays.
Yes, Keyboard.print("text") types a whole string.
4 parts: Espressif ESP32-S3-DevKitC-1-N8R8 Development Board, 4 × 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 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (macro_keypad.ino).
About ₹1,934 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Native USB HID on the ESP32-S3; Sending key combinations; Using internal pull-ups for buttons.
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.