Hey everyone, ive tried searching, but havent found anything helpful
basically i just got my arduino yesterday, and ive done some simple LED pattern stuff. i tried to do the project in the "getting started with arduino book" through MAKE that was where you press a button, and the LED lights up.
i typed up the code myself, and there are no other problems with it. i had typed out the code so that if i pressed the button, it did a certain pattern; but i removed that and made it just turn on like the project in the book (over complicating it was what i predicted my problem to
be)
still, it gives me a message that says "error- expected unqualified-id before numeric constant" and it highlights my line that is
#define BUTTON 4
i have no clue what to do, im just new to this, go easy..
heres my code. (the extra LEDs were used in the more complicated version, but this exact code will not work)
#define LED 13
#define LED1 12
#define LED2 11
#define LED3 10
#define LED4 9
#define LED5 8
#define LED6 7
#define LED7 6
#define BUTTON 4
int val = 0
void setup()
{
pinMode(LED, OUTPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(BUTTON, INPUT);
}
void loop(){
val = digitalRead(BUTTON);
if (val == HIGH) {
digitalWrite(LED, HIGH);
} else {
digitalWrite(LED, LOW);
}
}
thanks