Hello, thanks for the reply I want use 5 sensors, Iâm following the of the guy in this video. Caixa de ĂĄgua, I managed to copy the code, but in the end give me a error.
Blockquote
exit status 1 âblinkLedWidgetâ was not declared in this scope
Blockquote
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
This sketch shows how to write values to Virtual Pins
NOTE:
BlynkTimer provides SimpleTimer functionality:
http://playground.arduino.cc/Code/SimpleTimer
App project setup:
Value Display widget attached to Virtual Pin V5
*************************************************************/
int sensor1 = 27;
int sensor2 = 26;
int sensor3 = 25;
int sensor4 = 33;
int sensor5 = 32;
int nivel, diferente;
int lersensor1, lersensor2, lersensor3, lersensor4, lersensor5;
int ant_sensor1, ant_sensor2, ant_sensor3, ant_sensor4, ant_sensor5;
String nivel_display; //Sobe ou Desce
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Blynk.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "F31oHir6Q4qt-xnKaJjUfKQ2Kndcz3jK";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Vodafone-26EFC3";
char pass[] = "74aYpEqGU8";
WidgetLED led1(V16);
WidgetLED led2(V15);
WidgetLED led3(V14);
WidgetLED led4(V13);
WidgetLED led5(V12);
WidgetTerminal terminal(V3);
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
// Serial.printIn (nivel);
// Blynk.virtualWrite(V1, nivel);
}
void setup()
{
// Debug console
Serial.begin(9600);
pinMode(sensor1, INPUT);
pinMode(sensor2, INPUT);
pinMode(sensor3, INPUT);
pinMode(sensor4, INPUT);
pinMode(sensor5, INPUT);
// digitalWrite (sensor1, HIGH);
// digitalWrite (sensor2, HIGH);
// digitalWrite (sensor3, HIGH);
// digitalWrite (sensor4, HIGH);
// digitalWrite (sensor5, HIGH);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
// Clear the terminal content
terminal.clear();
terminal.println(F("Monitorização do Nivel de Ăgua"));
terminal.println(F("------------------------------"));
terminal.println(F("Digite 'status' e receba os valores dos sensores"));
terminal.flush();
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
nivel_display = "Desconhecido";
timer.setInterval(1000L, blinkLedWidget);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
}