Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Nivedh
Published © CC BY-NC

ESP8266 - Beginner Tutorial + Project

An ultimate tutorial for beginners on how to connect and use an ESP8266 via Arduino and program it to blink an LED using the Blynk app.

BeginnerProtip255,767
ESP8266 - Beginner Tutorial + Project

Things used in this project

Story

Read more

Code

Uploading the program

Arduino
Copy the code in to your Arduino IDE and upload it. You have to enter your auth code, Wifi name, and wifi password in the corresponding variable declaration section of the code.
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "your auth token code from blynk app";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "your wifi name";
char pass[] = "your wifi password";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

Credits

Nivedh
3 projects • 32 followers
A passionate Electronics and communication engineering student who loves to make & invent new stuffs. Good at programing & hardware field.

Comments