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
}
}


