Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RoboCore/163cafe7a09f090c166f826a431fecae to your computer and use it in GitHub Desktop.
Save RoboCore/163cafe7a09f090c166f826a431fecae to your computer and use it in GitHub Desktop.
Controle o seu Arduino sem precisar escrever o seu código, utilizando o Blynk.
#define BLYNK_PRINT Serial
#include "ESP8266_Lib.h"
#include "BlynkSimpleShieldEsp8266.h"
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "seu-token-aqui";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "sua-rede-wifi-aqui";
char pass[] = "sua-senha-da-rede-wifi-aqui";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include "SoftwareSerial.h"
SoftwareSerial EspSerial(10,11); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
Blynk.run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment