使用ESP8266将Arduino连接到Blynk

问题描述 投票:3回答:1

所以我今天拿到了我的Arduino Uno。对于一个项目,我希望能够通过Wifi(通过Blynk应用程序)控制我的Arduino上的一些继电器。为此,我想使用ESP8266-01作为Wifi屏蔽。

我用过这个教程:https://create.arduino.cc/projecthub/nolan-mathews/connect-to-blynk-using-esp8266-as-arduino-uno-wifi-shield-m1-46a453

唯一的区别是我正在使用Win10。这是我得到的:

好吧,第一个问题是我无法刷新ESP的固件(从Sunfounder得到它),如教程中所述。下载最新固件并使用ESP8266 Flasher进行闪存。

其他问题,当我尝试从第一个教程编译代码时,我总是得到错误:

C:\Users\Chris\Documents\Arduino\libraries\Blynk\examples\Boards_WiFi\ESP8266_Shield\ESP8266_Shield.ino:5:21: fatal error: ESP8266.h: No such file or directory

如上所述,我已经安装了所有库。不能再想办法了。任何帮助将非常感激。来自柏林,克里斯的致敬。要关闭代码,我尝试上传到主板(Arduino Board或通用ESP8266都不起作用)

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial  // Comment this out to disable prints and    save space
#include <ESP8266.h>
#include <BlynkSimpleShieldEsp8266.h>
// Set ESP8266 Serial object
#define EspSerial Serial
ESP8266 wifi(EspSerial);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "???";
void setup()
{
 Serial.begin(115200);  // Set console baud rate
 delay(10);
 EspSerial.begin(115200);  // Set ESP8266 baud rate
 delay(10);
 Blynk.begin(auth, wifi, "???",
"???");
}
void loop()
{
 Blynk.run();
}

???我切换了我的令牌和数据。

arduino esp8266 blynk
1个回答
3
投票

尝试改变这个

#include <ESP8266.h>

对此

#include <ESP8266_Lib.h>

该文件已在this commit中重命名。

© www.soinside.com 2019 - 2024. All rights reserved.