Switch and LED circuit with Arduino

From Knowledge Kitchen
Jump to navigation Jump to search


This example shows how to read a switch using the Arduino and blink an LED in response. This is one of the simplest examples of the input -> process -> output model of interaction mentioned by Crawford in "The Art of Interactive Design".


The circuit

Switch and LED circuit with Arduino


The code

Code for switch and LED circuit with Arduino


Questions

  1. How would you modify the circuit (without altering the code) so that the LED was turned on by default, and only went off when someone pressed the switch?


What links here