Перейти к содержимому

ESP32 Pushbutton Tutorial: Your First INPUT | Pull-Down Resistor, Blocks + Arduino IDE (Lesson 4)

Thinking Robot

0:00 / 0:00

ESP32 Pushbutton Tutorial: Your First INPUT | Pull-Down Resistor, Blocks + Arduino IDE (Lesson 4)

55 просмотров · 7 дн. назад
Thinking Robot
454 подписчика
55 просмотров · 7 дн. назад
🔘 Until now our ESP32 has only controlled OUTPUTS. In this lesson we give it its first INPUT: a pushbutton! You'll learn how a breadboard works, what's inside a 4-leg pushbutton, and how to wire it to GPIO 14 with a 10 kΩ pull-down resistor (and why a floating pin reads random values). Then we read the button with block coding on Thinking Robot Lab, watch the values (0 and 1) in the Serial Monitor, and use an IF block so the ESP32 blinks its LED 3 times every time you press the button. Finally, we build the exact same program in the Arduino IDE and explain it line by line. This is a big step: the ESP32 is no longer following a fixed sequence. It's making DECISIONS based on an input! 🧠 🧰 WHAT YOU NEED • ESP32 DevKit • Breadboard • Pushbutton (4-leg tactile switch) • 10 kΩ resistor • Jumper wires + USB cable 🔌 WIRING • 3.3V → one side of the pushbutton • Other side of the pushbutton → GPIO 14 • GPIO 14 → 10 kΩ resistor → GND (pull-down) Not pressed = 0 (LOW) · Pressed = 1 (HIGH) 🧩 WHAT YOU'LL LEARN • Breadboard basics: connected rows, the centre gap and power rails • How a pushbutton connects its two sides when pressed • Floating pins, pull-down vs pull-up resistors • Variables + read digital pin in blocks • Serial Monitor and the Plotter on Thinking Robot Lab • IF / ELSE decisions + repeat loops • digitalRead, Serial.println, if and for loops in the Arduino IDE 🏆 YOUR CHALLENGE Count button presses! After 5 presses turn the LED ON, after 5 more turn it OFF. Watch out for button bounce and for a button that's held down. You'll need to detect ONE proper press. Hints: variables, the previous button state, counters, delays and IF conditions. Try it yourself first. The solution comes in the next lesson! 📘 The full lesson page with the wiring table, final Arduino code, challenge hints AND the Lesson 3 SOS solution is on https://learn.thinkingrobot.in 🛒 GET THE KITS Comment "KIT" and we'll DM you the link! Or grab them here: ⭐ ESP32 IoT Explorer Kit (45+ projects, everything for this series): https://thinkingrobot.in/products/iot... 🤖 PICO Bot: 4-Wheel Robot, ESP32 Edition (take these skills into robotics): https://thinkingrobot.in/products/pic... 🔌 ESP32 DevKit board only: https://thinkingrobot.in/products/esp... 🛍️ All kits & components: https://thinkingrobot.in/products 🔗 LEARN & BUILD WITH US 🧩 Thinking Robot Lab (code real ESP32 boards with blocks, right from your browser): https://lab.thinkingrobot.in 📚 Thinking Robot Learn (step-by-step lessons, code, challenges & courses): https://learn.thinkingrobot.in 🌐 Website & shop: https://thinkingrobot.in 📺 THE ESP32 SERIES Lesson 0: What is IoT? Series intro Lesson 1: Blink the built-in LED (digital signals) Lesson 2: LED Fade with PWM (variables, Serial Monitor & loops) Lesson 3: The SOS Challenge Lesson 4: Pushbuttons, your first INPUT (this video) Next: the button-counting challenge solution 🤖 WHAT IS THINKING ROBOT? Thinking Robot is a Pune-based robotics and electronics brand built for makers & builders. We offer hands-on robotics, electronics and IoT kits, like the PICO Bot robot kit, ESP32 IoT kits and Arduino kits, plus DIY components, so kids, students, schools and hobbyists can learn by actually building real projects. Alongside the kits, we run Thinking Robot Lab, a block-coding playground that programs real ESP32 boards from your browser, and Thinking Robot Learn, where you'll find step-by-step lessons like this series. Our goal is simple: help every young maker go from blinking their first LED to building their own robots. 📩 Schools, bulk orders & custom projects: ✉️ info@thinkingrobot.in 💬 WhatsApp: +91 8275478093 → https://wa.me/918275478093 👍 Like, subscribe and turn on notifications so you don't miss the challenge solution! #ESP32 #Pushbutton #PullDownResistor #Breadboard #BlockCoding #ArduinoIDE #ThinkingRobot #IoT #STEM #Electronics