Objective:
Learn how a slide switch works as a digital input to control an LED output based on switch position.
Steps to Perform:
- Click "Start Simulation" to power up the Arduino circuit
- Click on the slide switch to toggle its position
- Observe how the LED turns ON when switch is in HIGH position
- Click the switch again to toggle back
- The LED will turn OFF when switch is in LOW position
Key Concepts:
- Slide Switch: Two-position switch that maintains its state (ON/OFF)
- Digital Input: Switch provides HIGH (5V) or LOW (0V) signal
- Digital Output: Arduino writes HIGH/LOW to LED pin to control it
- digitalRead(): Reads switch state from digital pin 10
- digitalWrite(): Sets LED pin HIGH (ON) or LOW (OFF)