Blynk + ESP8266 ESP-01 Control GPIO13 LED
目的:
使用ESP8266 ESP-01+ 3.3V/5V Adapter + Arduino UNO 利用Blynk APP 控制 GPIO13
硬體 (電子元件):
1)麵包板 x 1 , 杜邦線 若干
2)ESP8266 ESP-01 Board x 1
3) 3.3V/5V Linear Regulator Voltage x1 (3V3/5V 電源模組)
4) Arduino UNO Board x 1
軟體:
1)Arduino IDE 1.6.5版本
2) RealTerm 軟體
3) Blynk APP
4) Blynk APP API KEY + WIFI SSID PASSWORD
接腳說明:
- 3V3:電源正極 ( 3 ~ 3.6 V )
- GND:電源負極
- TX:串列資料傳送接腳
- RX:串列資料接收接腳
- IO0:低準位:Flash Mode
- IO2:GPIO ( 未來開放 )
- RST:低準位時晶片重置( 一般浮接就好 )
- EN:晶片致能接腳( 就是接 VCC )
//==================================================================
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#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[] = "930985854e8f4bc6beb3b570768ce763";
//Auth Token : 930985854e8f4bc6beb3b570768ce763
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "74170287";
char pass[] = "24063173";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(4, 5); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
void setup() {
// Set console baud rate
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();
}
沒有留言:
張貼留言