Saturday, September 6, 2014

Basic Arduino Part2: connect with button


 Code for this project.

int LED = 12;
int BUTTON =4;

void setup(){
 
  pinMode(LED,OUTPUT);
  pinMode (BUTTON, INPUT);
 
}

void loop (){
  if(digitalRead(BUTTON)==HIGH)
  {
    digitalWrite(LED,HIGH);
  } else
  {digitalWrite(LED,LOW);} 
 
}


Demonstration:


Basic Arduino LED blink:

this video is presenting of how to connect led wire from arduino board to Solderless bredboard mini with 30k resister