我让 ESP32cam 工作了几天,然后在启动时开始收到该消息。重新加载程序,仍然没有相机。失望
错误:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6364
entry 0x400806b8
Brownout detector was triggered
Run Code Online (Sandbox Code Playgroud)
相机标签: HW-297 OV2640
程序中:
#define CAMERA_MODEL_AI_THINKER
Run Code Online (Sandbox Code Playgroud)
板卡选择:ESP32 Wrover模块
我正在创建一个涉及蓝牙和 WiFi 的应用程序。我首先将手机连接到蓝牙,并通过它传递 WiFi ssid 和密码。然后,在收到 ssid 和密码后,我尝试将其连接到 WiFi。我设法将 ssid 和密码存储到一个字符数组中。
从蓝牙发送数据后,ESP32 与 WiFi 建立连接后,蓝牙断开。我无法再次连接蓝牙,因为 WiFi 已连接,因为我通过 Bluetooth.read() 控制代码中的某些语句,所以我需要允许连接在 WiFi 和蓝牙之间共存。
该项目由 SPIFFS(闪存保存)组成。首先从蓝牙传递WiFi ssid和密码,然后,我将接收到的蓝牙数据连接到一个字符数组中,以便稍后将其连接到互联网。
\n
我首先想到添加一个回调,在设备尝试连接时发出警报,但在文档中找不到任何能够执行此操作的代码。我有一个回调函数,可以告诉我设备何时连接和断开连接。\n
\n我搜索并找到了相关内容,Menuconfig但找不到它所在的位置。\n
\n这是我正在阅读的内容:https: //www.espressif.com/sites/default/files/documentation/ESP32_FAQs__EN.pdf
5.3.2.\nHow do ESP32 Bluetooth and Wi-Fi coexist?\nIn the menuconfig menu, there is a special option called \xe2\x80\x9cSoftware controls WiFi/ \nBluetooth coexistence\xe2\x80\x9d, which is used to control the ESP32\'s Bluetooth and Wi-Fi \ncoexistence using software, thus balancing the coexistence requirement for controlling \nthe RF module by both …Run Code Online (Sandbox Code Playgroud) 我开始在Arduino上使用端口,而不是手动将每个引脚设置为低电平或高电平.这非常有用且速度更快.我正在进行一个项目,我需要至少一个完整端口(8位)和至少一个串行端口.
我想使用Arduino UNO,但它只有一个完整的端口,端口D. PD0和PD1用于串行通信.这意味着我不能使用端口D.
我想知道是否有可能将多个端口合并为"虚拟端口".最后我想要这样的东西:
PORTX = 0b11111111; // the first 2 bits are PB0/PB1 and bit 3-8 are PD3-PD8
Run Code Online (Sandbox Code Playgroud)
这有可能吗?
我计划从旧的 5V Arduino Nano 迁移到新的 Arduino Nano 33 IoT。我已经使用软件串行 (SoftwareSerial.h) 为旧的 5V Arduino Nano 编写了一个功能代码,以便与 Sim800L 模块进行通信。然而,当我将板更换为新的 Arduino Nano 33 IoT 时,找不到软件串行库。
我尝试在“草图”下的“包含库”菜单中找到它,但该库根本不存在。鉴于该产品是如此新,我还没有找到任何有用的研究来帮助我解决这个问题。我的 EEPROM 库也有同样的问题。
#include <SoftwareSerial.h>
#include <EEPROM.h>
Run Code Online (Sandbox Code Playgroud)
有谁知道如何为新的 Nano 33 IoT 板包含 SoftwareSerial.h 和 EEPROM.h 库,或者可能知道用于新板的新库?
以下是我编译时收到的错误消息:
Sim800L_V7.1:3:12: error: SoftwareSerial.h: No such file or directory
#include <SoftwareSerial.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
SoftwareSerial.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激谢谢
Arduino平台上的C++程序没有main()其他平台上的功能;相反,它必须有两个名为setup()和 的函数loop()。但是根据 C++ 标准——所有的 C++ 程序都必须有一个main()函数。
那么,这样的C++代码是否符合标准呢?Arduino 上的 C++ 编译器/链接器/加载器是否符合标准?
这是 Arduino 代码,但我有一种感觉,我的错误一般是与 C++ 相关,而不是特定于 Arduino。我对指针和字符串很陌生,所以我在这方面可能做错了什么。
这是来自一个更大的程序,但我已将其缩减为尽可能少的代码,这样我仍然可以重现该错误。
它应该只迭代 的字母text[]并将每个字母保存到 中newText[0][0],以及 printnewText[0][0]和 counter 变量i。
void setup() {
Serial.begin(9600);
}
void loop() {
const char text[] = "chunk";
static char newText[][10] = {};
static unsigned int i=0;
static int code = 0;
if(code == 0){
newText[0][0] = text[i]; //This
Serial.print(i);
Serial.println(newText[0][0]); //This
i++;
if(i>=strlen(text)){
code=1;
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我有代码时,i在第二次迭代时跳转到某个数字,例如 104,此时它应该等于 1。(确切的值根据代码的具体外观而变化。)如果我注释掉其中任何一行评论//This,然后计数器工作正常。另外,如果我切换Serial.print(i);它之前的行,那么它就可以了。
我正在开发基于 Arduino 的代码,其中我需要为串行命令提供条件编译以在串行终端上打印数据。
我在代码开头使用“#define DEBUG”,如果定义了它,则将执行所有串行打印命令,并且串行监视器上将有数据,否则,它将跳过代码中的串行打印命令。
现在,我需要开发一个代码,以便用户可以输入是否在代码中包含“#define DEBUG”语句,以选择DEBUG模式/非DEBUG模式在串行终端上打印数据。意思是需要为条件编译语句提供条件。
下面是我的代码
#define DEBUG // Comment this line when DEBUG mode is not needed
void setup()
{
Serial.begin(115200);
}
void loop()
{
#ifdef DEBUG
Serial.print("Generate Signal ");
#endif
for (int j = 0; j <= 200; j++)
{
digitalWrite(13, HIGH);
delayMicroseconds(100);
digitalWrite(13, LOW);
delayMicroseconds(200 - 100);
}
}
Run Code Online (Sandbox Code Playgroud)
目前,当我不需要在终端上打印串行命令时,我正在手动注释“#define DEBUG”语句。
请建议。
感谢和问候...
我正在开发一个使用 Flash 数据保存的项目。我正在使用 ESP32 的 SPIFFS 库,目前正在尝试将每行的数据存储到字符串中。由于我可以控制文件中可以包含多少内容,因此不需要超过 3 个字符串来存储数据。我可以轻松地使用 来存储第一行内容readStringUntil。但我无法从第 2 行和第 3 行获取内容。
\n对于第一行,我使用以下代码:
//Pegar a primeira linha do arquivo, onde ser\xc3\xa1 armazenado o nome do WIFI (ssid)\nvoid first_line (){\n file = SPIFFS.open("/wifi.txt", "r");\n\n while (file.available()) {\n String first_line = file.readStringUntil('\\n');\n Serial.print(first_line);\n break;\n }\n\n file.close();\n}\nRun Code Online (Sandbox Code Playgroud)\n我使用此函数将代码写入文件:
\n// Escrever mensagem dentro do arquivo\nvoid write_file_info(String message) {\n file = SPIFFS.open("/wifi.txt", FILE_WRITE);\n\n if (!file){\n Serial.println("Error opening file");\n return;\n }else{\n Serial.println("Success opening file");\n }\n\n if (file.println(message)){\n Serial.println("File was …Run Code Online (Sandbox Code Playgroud) 在arduino上,我需要在类似以下函数中使用Serial.print():
void loop()
{
serial_send(any_type);
}
void serial_send(type message)
{
Serial.print(message);
}
Run Code Online (Sandbox Code Playgroud)
Serial.print可以接受任何类型的变量,例如,作为int,double或String。如何获得相同的行为,serial_send所以不必指定类型?
_在 C# 中,当想要显式忽略操作结果时,有一个方便的功能,即使用下划线作为丢弃变量。
我目前正在 C++ 中寻找等效的功能或解决方法,它允许我在从函数检索多个值时丢弃特定值或节省内存分配。
例子:
假设我有一个这样的函数:
void readValues(float& temperature, float& humidity, float& dewpoint, float& tempTrend, float& humTrend) {
// Some operation to retrieve values
}
Run Code Online (Sandbox Code Playgroud)
如果我只需要知道温度,并且没有特定于温度的函数,如何以最节省内存的方式丢弃其他值?
或者任何其他方法可以在忽略 Arduino/ESP32 环境中函数的某些返回值时帮助节省内存空间?
我现在在做什么:
float temperature;
float discard;
readValues(temperature, discard, discard, discard, discard);
Run Code Online (Sandbox Code Playgroud)
我尝试过的:
float temperature;
readValeus(temperature, null_ptr, null_ptr, null_ptr, null_ptr);
Run Code Online (Sandbox Code Playgroud)
float temperature;
readValues(temperature, 0, 0, 0, 0);
Run Code Online (Sandbox Code Playgroud)
感谢您的任何见解或建议!
arduino-c++ ×10
arduino ×7
c++ ×5
esp32 ×3
arduino-ide ×1
c# ×1
camera ×1
equivalent ×1
freestanding ×1
port ×1