Button Input¶
Buttons are the simplest way to provide user input to your projects. A momentary button closes the circuit only while pressed, allowing your code to respond to taps, presses, or long holds.
What It Does¶
This example reads the state of a button and shows how your program can respond when the button is pressed. It introduces the concept of digital input and forms the basis for interactive projects.
Real-World Applications¶
Buttons are everywhere in electronics, from toys to industrial systems. With button inputs, students can create:
- ๐ฎ Game Controls โ Simple joysticks, trigger buttons, or start/stop inputs.
- ๐ Doorbells & Buzzers โ Triggering a sound or notification.
- ๐ Smart Home Controls โ Light switches, fan toggles, or appliance triggers.
- ๐ค Robotics โ Manual override or reset buttons.
- ๐งช Learning Experiments โ Teach the basics of logic, inputs, and event-driven programming.
Using a button, students begin to understand how human interaction drives digital systems.
โ Once you can read a button press, you can extend it to control LEDs, buzzers, motors, or even start whole projects with a single press.