Skip to content

Instantly share code, notes, and snippets.

@gsampallo
Created October 16, 2020 20:13
Show Gist options
  • Save gsampallo/ba86abae41cb557fcb28a71a72534c2a to your computer and use it in GitHub Desktop.
Save gsampallo/ba86abae41cb557fcb28a71a72534c2a to your computer and use it in GitHub Desktop.
DPRE - Blynk - Envio de datos del sensor de temperatura LM35
#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