Students will
- Prevent a floating digital input with INPUT_PULLUP
- Identify the internally connected button legs
- Explain why released is HIGH and pressed is LOW
Arduino Uno R3
Read a momentary pushbutton with a defined resting state and make its active-low behavior visible in Serial Monitor.
Reviewed connection map
Read before uploading
const int BUTTON_PIN = 8;
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
bool pressed = digitalRead(BUTTON_PIN) == LOW;
Serial.println(pressed ? "pressed" : "released");
delay(50);
}Optional engineering record
Choose the prompts that help students explain predictions, evidence, debugging, and transfer. Saving creates a new entry in this browser’s Rudi notebook.
Use these prompts if they help students capture evidence, decisions, or questions. You do not need to complete every prompt or create an entry at every step.
Rotate or reposition the button so D8 and GND are not connected to the same internal leg pair.
Confirm pinMode uses INPUT_PULLUP and that the sketch reads the same pin used by the circuit.
2026 middle school standards
These are evidence-based crosswalk candidates for curriculum review—not a claim of official alignment.
Students trace variables, selection, or iteration in the supplied sketch and connect code to physical behavior.
Lesson evidence: Explanation of active-low selectionStudents isolate variables, compare observed behavior with the intended purpose, and document a revision.
Lesson evidence: Repeated released and pressed readingsfloating-inputs · sketch-foundations
Starting point, not verified curriculum. Review the actual hardware, circuit, code, power requirements, and classroom conditions.
After teaching this lesson