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.