Created
August 8, 2018 19:38
-
-
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.
This file contains hidden or 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 "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