Skip to content

Instantly share code, notes, and snippets.

@OtacilioN
Last active June 27, 2018 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OtacilioN/b3c1aba5a2fdb29bce24f8c8af1cdfa0 to your computer and use it in GitHub Desktop.
Save OtacilioN/b3c1aba5a2fdb29bce24f8c8af1cdfa0 to your computer and use it in GitHub Desktop.
Blynk IoT
http://arduino.esp8266.com/stable/package_esp8266com_index.json
#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