Page 23 - Demo
P. 23
Expected Output / Learning Outcome On each button press, LED brightness increases step by step. After reaching maximum brightness, next press resets LED back to OFF. Students learn:%u2022 How to read input from a button.%u2022 Using variables & limits for controlled brightness.%u2022 Combining input and output for interactive control. Practice Questions %u2013 Project 6 Multiple Choice Questions (MCQs)Q1. What happens to LED brightness when the button is pressed multiple times?a) Always stays ONb) Increases step by step until max, then resetsc) Always turns OFFd) Randomly changesAnswer: b) Increases step by step until max, then resetsQ2. Which Arduino function is used to read button state?a) digitalWrite()b) digitalRead()c) analogRead()d) analogWrite()Answer: b) digitalRead()Q3. What is the role of the 10k%u03a9 resistor in this circuit?a) Increases LED brightnessb) Protects the buttonc) Acts as pull-down to avoid false signalsd) Stores currentAnswer: c) Acts as pull-down to avoid false signalsQ4. Why is delay(200); used in the code?a) To make LED blinkb) To smooth fadingc) To debounce button and avoid multiple jumpsd) To reset ArduinoAnswer: c) To debounce button and avoid multiple jumps Fill in the Blanks