Created
October 16, 2020 20:13
-
-
Save gsampallo/ba86abae41cb557fcb28a71a72534c2a to your computer and use it in GitHub Desktop.
DPRE - Blynk - Envio de datos del sensor de temperatura LM35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BLYNK_PRINT Serial | |
#include <ESP8266WiFi.h> | |
#include <BlynkSimpleEsp8266.h> | |
char auth[] = "COPIE_AUTH_KEY_AQUI"; | |
char ssid[] = "RED_WIFI"; | |
char pass[] = "CLAVE"; | |
BlynkTimer timer; | |
float vref = 3.3; | |
float resolucion = vref/1023; | |
void setup() { | |
Serial.begin(115200); | |
Blynk.begin(auth, ssid, pass); | |
timer.setInterval(1000L, actualizarTemperatura); | |
} | |
void actualizarTemperatura() { | |
float valor = analogRead(A0); | |
float temperatura = (valor*resolucion)*100; | |
Blynk.virtualWrite(V0, temperatura); | |
} | |
void loop() { | |
Blynk.run(); | |
timer.run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment