Example 02 from "Getting Started with Arduino"

I'm doing the example 02 from "Getting Started with Arduino", but I can't do well.
It is to control the LED by the button.

I write as below, and is verified. I can't understand why it doesn't move.

// Example02  :  Lighting LED while pusing the button

const int LED = 13;  //LED connect with digital pin 13
const int BUTTON = 7;//The pin push button is connected

int val = 0;        //??????????????????

void setup(){
  pinMode(LED,OUTPUT);//Arduino?LED??????????
  pinMode(BUTTON,INPUT);//select BUTTON to output
}

void loop(){
  val=digitalRead(BUTTON);//???????val???
  
  
  //???HIGH(????????????)??
  if (val == HIGH){
  digitalWrite(LED, HIGH);//On LED
  }else{
  digitalWrite(LED,LOW);  //delete LED
  } 
}

:astonished: Your wiring is totally wrong. Actually each of your wires doesn't connect to anything. You don't understand how a breadboard works? It has rows and columns, like in this picture (except the row at the middle):

Here is how you connect a button that will blink the onboard LED: http://arduino.cc/en/tutorial/button

Thank you so much!! It works well :slight_smile: :slight_smile: