Incluir wifimanager en mi codigo

Hello guys I am very new to this arduino I want to include wifimanager to my code I want to enter token and wifi username and password, and I have not succeeded, I try in many ways … I am very disoriented, someone can help me with this I leave the code I’m using wemos D1 mini in advance thanks

//#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "gyyR8xzGjenl610qwc6wioY1H12xBQs4";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "TORRES";
char pass[] = "19841887";

// Keep this flag not to re-sync on every reconnection
bool isFirstConnect = true;
// This function will run every time Blynk connection is established
BLYNK_CONNECTED() 
{
  if (isFirstConnect) 
  {
    // Request Blynk server to re-send latest values for all pins
    Blynk.syncAll();
    isFirstConnect = false;
  }
}
bool alarm_mode = false ;
int sensor = 5; //GPIO5 D1 Pin number on which sensor is connected
int buzzer = 15; //GPIO15 D8 Pin number on which buzzer is connected
int alarm_led = 4; //GPIO4 D2 Pin number on which alarm status led is connected
int alarm_led_off = 0; //GPIO0 D3 Pin number on which alarm status led is connected

BlynkTimer timer;

void myTimerEvent(){
   
  if(digitalRead(sensor) == 0){
    Blynk.virtualWrite(V0, "ACTIVADO");
     Blynk.notify("alarma activada");
      delay (1000);
  }
  if(digitalRead(sensor) == 1)
  {
    Blynk.virtualWrite(V0, "DESACTIVADO");
     Blynk.notify("alarma desactivada");
     delay (1000);
    if(alarm_mode == true)
    {digitalWrite(alarm_led, HIGH); 
            
    }
  }
  }
BLYNK_WRITE(V1) {
  switch (param.asInt()) {
    case 1: { // Item 1
      //Serial.println("Item 1 selected");
      alarm_mode = true;
      digitalWrite(alarm_led, HIGH); 
      digitalWrite(alarm_led_off, LOW);
      break;
    }
    case 2: { // Item 2
      //Serial.println("Item 2 selected");
      alarm_mode = false;
      digitalWrite(buzzer, LOW);  
      digitalWrite(alarm_led, LOW);
      digitalWrite(alarm_led_off, HIGH);  
      break;
    }    
  }
}

void setup()
{
  pinMode(sensor, INPUT_PULLUP);
  pinMode(buzzer, OUTPUT);
  pinMode(alarm_led, OUTPUT);
  pinMode(alarm_led_off, OUTPUT);
  
  // Debug console
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
}

Have you checked out this thread?

Have you installed and included libraries before?

Thank you very much for answering! I tried to make it work following that method but I did not have positive results, I have been trying for days to make it work with my code and I have not succeeded

To be honest, saying things like “I’ve tried lots of things but I cant get it to work” doesn’t really help us to help you. In fact, it simply says that you’ve probably made lots of random changes without any logical systematic approach to solving the issue.

I’d suggest that you take one approach, try it, document what does and doesn’t work, then share that information with the forum. You’ll probably get a working solution much quicker that way.

Pete.

If I have the same libraries that you recommend to me … I am honest I am electronic but zero programming, that code I modified a little so that it works for me as a home alarm notification communicator modify little things almost nothing and it works well add wifimanager and I don’t know how to do it … I know I have to do a programming course I’m sorry …

Hello Pete I have been with this for days, the problem is that I am electronic but I do not know anything about programming, I removed that code from the internet I modified it a little so that it works as a home alarm communicator (warns if the alarm is activated ) I’ve been reading you for a long time … that you write to me it’s like I’m talking with the MARADONA of the programming, I’m from Argentina Greetings Pete, my respects!

If it’s a home alarm system, why do you need to add WiFiManager? What’s the logic behind this?

Pete.

It is a device that connects to the sirens output of an alarm, communicates if an alarm is activated … it is installed in a motorhom and moves through various places where it stays a few days and continues its route, it is not fixed in a only place, for that reason I need to be able to configure the wifi network by wifimanager

Have you considered GPRS, or mixed GPRS and WiFi, depending on what is available?

Pete.

Yes I thought about it, but since my knowledge of programming is very low, I wanted to start implementing wifimanager to my code and then add more functions, but for now with wifimanager it is enough for me

Okay, well start by doing as I suggested earlier and share your chosen approach, along with information about what does and doesn’t work for you.

Pete.