Read Switch and Display on LED.

  1. Aim: Blink the LED when the Switch Button is press


Arduino Read Switch and Display on LED.JPG


  1. digital 2 is declared as the input port to read the values from the switch.
  2. digital 13 is the output LED for our board in this experiment
  1. wait 0.1 is the delay timing


caption


Our experiment can be resume as :

  1. when Button is clicked, Always when digital 2 send the value 1 to the digital 13 ,
  2. it receives it and ON the LED for 0.1 sec then OFF when it is released.
  3. and it will keep repeating until stop is clicked