Students will
- Read a button with a defined resting state
- Control a current-limited LED
- Trace input, decision, and output in a sketch
Arduino Uno R3
Build a stable digital input, control a protected LED, and explain how a physical action becomes program behavior.
Reviewed connection map
Read before uploading
const int BUTTON_PIN = 8;
const int LED_PIN = 9;
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
const int buttonState = digitalRead(BUTTON_PIN);
const bool isPressed = buttonState == LOW;
digitalWrite(LED_PIN, isPressed ? HIGH : LOW);
Serial.println(isPressed ? "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.
Confirm INPUT_PULLUP and the button-to-GND connection.
Test polarity, resistor placement, GND, and the D9 wire independently.
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: Input–decision–output code traceStudents isolate variables, compare observed behavior with the intended purpose, and document a revision.
Lesson evidence: Five-trial response recordfloating-inputs · ohms-law · power-and-signals
Starting point, not verified curriculum. Review the actual hardware, circuit, code, power requirements, and classroom conditions.
After teaching this lesson