我正在做一个项目,在这个项目中,我试图通过ESP8266和Arduino uno使用Blynk应用程序打开无线上网LED。我相信电路是正确设置的,因为我能够运行一个空脚本,并通过串行监视器发送"AT“命令并获得反馈。ESP8266也出现在我的wifi设置上。然而,从那以后,我试图在blynk应用程序上安装一个快速启动设备,这就是我被困在那里的地方。
主要的错误似乎是,我无法下载必要的库"ESP8266_Lib.h",以便该程序,Blynk最初提供给您运行。我试图在github上下载最新版本的blynk库,但这仍然没有帮助。
经过这个阶段的项目,我希望搬到一个阿德拉果引理板,并希望这将不会引起任何进一步的问题。提供的代码Blynk和错误消息如下:
/*************************************************************
This is a simple demo of sending and receiving some data. Be
sure to check out other examples!
*************************************************************/
// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "TMPLAFgrm8rq"
#define BLYNK_DEVICE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "h51Uz7shHDeBiaiIXRvEQUYDsBZbwzBf"
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <ESP8266_Lib.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
// Your WiFi credentials. // Set password to "" for open networks.
char ssid[] = "YourNetworkName"; char pass[] = "YourPassword";
BlynkTimer timer;
// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0) { // Set incoming value from pin V0 to a variable
int value = param.asInt();
// Update state
Blynk.virtualWrite(V1, value); }
// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{ // Change Web Link Button message to "Congratulations!"
Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
Blynk.setProperty(V3, "onImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
Blynk.setProperty(V3, "url","https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}
// This function sends Arduino's uptime every second to Virtual Pin 2
void myTimerEvent() {
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V2, millis() / 1000); }
void setup() { // Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass); // You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent); }
void loop() {
Blynk.run();
timer.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!
}j: 19 :10:致命错误: ESP8266_Lib.h:没有这样的文件或目录19\\包含 ^~~编译终止。退出状态1 ESP8266_Lib.h:没有这样的文件或导演
发布于 2021-12-22 20:46:08
BlynkESP8266_Lib仅在发布页面上的Blynk库的发行版zip中可用。见资产部分。
将BlynkESP8266_Lib文件夹从zip复制到草图文件夹中的libraries文件夹中。(草图簿文件夹的位置设置在Arduino IDE的Preferences对话框中。)
https://stackoverflow.com/questions/70454154
复制相似问题