Interfacing Slide Switch and Led with Arduino:

interfacing

ARDUINO CODE

Start Simulation

Click the slideswitch!