"Trigger" was not declared in this scope

The script is supposed to turn a esp8266 module into a wifi connector for my PC and i get the error "Trigger" was not declared in this scope. and i have no clue as to what it is and why it is causing it. bellow is the code.

#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager​
void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    pinMode(trigger,INPUT);
    pinMode(LED,OUTPUT);
     pinMode(power,OUTPUT);
    if(digitalRead(trigger) == HIGH){
    digitalWrite(power,HIGH);
    WiFiManager wifiManager;
    wifiManager.resetSettings();
    wifiManager.autoConnect("CIRCUIT DIGEST WiFi Manager");
    Serial.println("connected :)");
  }
}
void loop() {
  if (WiFi.status() == WL_CONNECTED)
        {
          digitalWrite(power,LOW);
          while(WiFi.status() == WL_CONNECTED){
            digitalWrite(LED,HIGH);
            delay(500);
            digitalWrite(LED,LOW);
            delay(200);  
          }
        }
        else {
          digitalWrite(LED,LOW);
        }

Help would be appreciated as i am new to this.

did you post all of your code? there's a missing closing brace "}"

petersimcoe:
i get the error "trigger" was not declared in this scope....

well duh! 'trigger' is NOT DECLARED neither as global nor local variable in the code you posted (that code does not compile anyway...).

what did you expect!

try putting something like this at the top of your code:

int trigger = 2 //or whatever pin number you are using on your board.

hope that helps...

Where did you get that code from? It doesn't look like it's complete and it has more errors than just that one.

Steve

What about 'power'? I don't see any declaration of that, either.

i get the error "Trigger" was not declared in this scope.

Considering that the Trigger variable does not even appear in the code you posted I find that surprising. You do, however, have a different variable named trigger that is not declared