how to fix expected unqualified-id....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ryanbrown204
    New Member
    • Mar 2014
    • 1

    how to fix expected unqualified-id....

    const int buttonPin = 2; // the number of the pushbutton pin
    const int ledPin = 13; // the number of the LED pin
    int pirPin = 7;
    int minSecsBetweenE mails = 60; // 1 min
    long lastSend = -minSecsBetweenE mails * 1000l;
    // variables will change:
    int buttonState = 0; // variable for reading the pushbutton status
    int led = 12
    void setup() {
    // initialize the LED pin as an output:
    pinMode(ledPin, OUTPUT);
    // initialize the pushbutton pin as an input:
    pinMode(buttonP in, INPUT);
    //initalize the digital pin as an output
    pinMode(led, OUTPUT);
    }

    void loop(){
    // read the state of the pushbutton value:
    buttonState = digitalRead(but tonPin);

    // check if the pushbutton is pressed.
    // if it is, the buttonState is HIGH:
    if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(le dPin, HIGH);
    }
    else {
    // turn LED off:
    digitalWrite(le dPin, LOW);
    }
    {
    long now = millis();
    if (digitalRead(pi rPin) == HIGH)
    {
    if (now > (lastSend + minSecsBetweenE mails * 1000l))
    {
    Serial.println( "MOVEMENT") ;
    lastSend = now;
    }
    else
    {
    Serial.println( "Too soon");
    }
    }
    delay(500);
    digitalWrite(le d, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000); // wait for a second
    digitalWrite(le d, LOW); // turn the LED off by making the voltage LOW
    delay(1000); // wait for a second
    }

    }
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    On what line does the compiler report an unqualified id?

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      The line before "void setup() {" is "int led = 12". That line needs to end with a semicolon.

      You are calling pinMode, digitalRead, digitalWrite, and delay without a function prototype.

      Comment

      Working...