safwan092

ESP8266-Arduino-Uno-BLYNK-SIMPLE

Dec 2nd, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. #include <ESP8266_Lib.h>
  2. #include <BlynkSimpleShieldEsp8266.h>
  3. #include <SoftwareSerial.h>
  4. #define ESP8266_BAUD 9600
  5. #define BLYNK_PRINT Serial
  6.  
  7. // You should get Auth Token in the Blynk App.
  8. // Go to the Project Settings (nut icon).
  9. char auth[] = "Your Blynk App Token Here";
  10.  
  11. // Your WiFi credentials.
  12. // Set password to "" for open networks.
  13. char ssid[] = "Your WiFi Name Here";
  14. char pass[] = "Your WiFi Password Here";
  15.  
  16. SoftwareSerial EspSerial(2, 3); // RX, TX
  17.  
  18. ESP8266 wifi(&EspSerial);
  19.  
  20. void setup()
  21. {
  22.   Serial.begin(9600);
  23.   delay(10);
  24.   EspSerial.begin(ESP8266_BAUD);
  25.   delay(10);
  26.   Blynk.begin(auth, wifi, ssid, pass);
  27. }
  28.  
  29. void loop()
  30. {
  31.   Blynk.run();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment