使用ESP8266将Arduino连接到Blynk

时间:2017-02-09 17:39:00

标签: arduino esp8266 blynk

所以我今天拿到了我的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获得)。下载最新固件并使用ESP8266Flasher闪存。

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

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();
}

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

1 个答案:

答案 0 :(得分:3)

尝试更改此

.gitignore

到这个

#include <ESP8266.h>

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