Last active
June 27, 2018 14:48
-
-
Save OtacilioN/b3c1aba5a2fdb29bce24f8c8af1cdfa0 to your computer and use it in GitHub Desktop.
Blynk IoT
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> | |
// Auth Token obtido dentro do Blynk app | |
char auth[] = "YourAuthToken"; | |
// WiFi para o node se conectar | |
char ssid[] = "YourNetworkName"; | |
char pass[] = "YourPassword"; | |
void setup() | |
{ | |
// Serial para debugar | |
Serial.begin(9600); | |
Blynk.begin(auth, ssid, pass); | |
} | |
void loop() | |
{ | |
Blynk.run(); | |
} |
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
http://arduino.esp8266.com/stable/package_esp8266com_index.json |
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[] = "YourAuthToken"; | |
// WiFi para o node se conectar | |
char ssid[] = "YourNetworkName"; | |
char pass[] = "YourPassword"; | |
void setup() | |
{ | |
// Serial para debugar | |
Serial.begin(9600); | |
Blynk.begin(auth, ssid, pass); | |
} | |
void loop() | |
{ | |
// Leitura do valor do LDR | |
int sensorValue = analogRead(A0); | |
Serial.println(sensorValue); | |
// Valor do LDR enviado para o Blynk | |
Blynk.virtualWrite(V1, sensorValue); | |
Blynk.run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment