Go Down

Topic: Error code a mystery (Read 837 times) previous topic - next topic

Zapo

I'm just trying to modify one of the programs (pushbottons) on the Arduino experimenter's board.  I keep getting this error:
   
        "error: expected unqualified-id before numemc constant"

I've checked it over, but just don't see it.

Here is the program -
int ledPin = 13
int inputPin2 = 2  // the number of the pushbutton pin
int inputPin3 = 3    // the number of the LED pin

// variables will change:
void setup() {
 // initialize the LED pin as an output:
 pinMode(ledPin, OUTPUT);      
 // initialize the pushbutton pin as an input:
 pinMode(inputPin2, INPUT);
pinMode (inputPin3, INPUT);  
}

void loop(){
 // read the state of the pushbutton value:
 //buttonState = digitalRead(buttonPin2);
if (digitalRead(inputPin2) == LOW)  {
 digitalWrite(ledPin, LOW);
} else if (digitalRead(inputPin3) == LOW) {
 digitalWrite(ledPin, HIGH);
}



AWOL

#1
Sep 02, 2010, 10:09 pm Last Edit: Sep 02, 2010, 10:10 pm by AWOL Reason: 1
Code: [Select]
int ledPin = 13[glow];[/glow]


Semicolons are good.

Quote
error: expected unqualified-id before nume[glow]ri[/glow]c constant"

Zapo

AWOL:

Thanks so much - I looked and looked, but didn't see :)  
I also needed another } at the bottom.

It's working now.  Seems like a lot of trouble to turn an LED on and off, but I'm learning.

Thanks again
Zapo

Go Up