Page 7 - Demo
P. 7
When the button is pressed %u2192 LED turns ON. When the button is released %u2192 LED turns OFF. Student learns:%u2022 How to read input signals from a button.%u2022 Using if-else logic in Arduino programs.%u2022 Role of pull-down resistor in avoiding false signals. Practice Questions %u2013 Project 2 (Button Controlled LED) Multiple Choice Questions (MCQs)Q1. Which Arduino function is used to read the button state?a) digitalWrite()b) digitalRead()c) analogRead()d) pinMode()Answer: b) digitalRead()Q2. What is the purpose of the 10k%u03a9 resistor in this project?a) To limit LED currentb) To act as pull-down resistor for buttonc) To increase brightness of LEDd) To slow down the programAnswer: b) To act as pull-down resistor for buttonQ3. If you press the button, the signal received at pin 2 will be:a) LOW (0V)b) HIGH (5V)c) Analog valued) Floating valueAnswer: b) HIGH (5V)Q4. In the code, what happens if the if condition is not true?a) LED will blinkb) LED will remain ONc) LED will remain OFFd) Nothing will happenAnswer: c) LED will remain OFF Fill in the Blanks