I'm having some troubles with a simple sketch that I cant seem to get to compile. Its an extension to the button sketch from the main examples on the learning page. It is the same button sketch but with a bit added so it can use two LEDs and two buttons instead of just one pair.
const int buttonPin2 = 2;
const int buttonPin3 = 3;
const int ledPin4 = 4;
cosnt int ledPin5 = 5; //For some reason this part is causing the problem but I cannot figure out why.
int buttonState2 = 0;
int buttonState3 = 0;
void setup() {
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
}
void loop() {
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
if (buttonState2 == HIGH) {
digitalWrite(ledPin4, HIGH);
}
else {
digitalWrite(ledPin4, LOW);
}
if (buttonState3 == HIGH) {
digitalWrite(ledPin5, HIGH);
}
else {
digitalWrite(ledPin5, LOW);
}
}
I'm not really sure why but it wont compile, it seems simple enough. Could someone give me any pointers as to what I'm doing incorrectly? Thanks in advance.