如何解决在 Adafruit Feather Huzzah ESP8266 中使用 I2S 库的问题
我有一个非常令人沮丧的问题,因为它看起来简单而微不足道。我尝试将 adafruit 分线板“Adafruit I2S MEMS Microphone Breakout”与“Adafruit Feather Huzzah ESP8266”与Arduino IDE 1.8.15一起使用。我安装了 esp8266 板,我可以上传简单的草图。但我想使用上面提到的麦克风来查看 Arduino IDE 串行监视器上的输出(如这里 https://www.youtube.com/watch?v=m8LwPNXqK9o)。
1.) 但是如果我尝试将“#include
1.) 草图:
#include <driver/I2S.h>
#define I2S_WS 5
#define I2S_SD 4
#define I2S_SCK 14
#define I2S_PORT I2S_NUM_0
void setup() {
// put your setup code here,to run once:
}
void loop() {
// put your main code here,to run repeatedly:
}
void i2s_install(){
static const int i2s_num = 0; // i2s port number
const i2s_config_t i2s_config = {
.mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX),.sample_rate = 44100,.bits_per_sample = i2s_bits_per_sample(16),.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_STAND_I2S | I2S_COMM_FORMAT_I2S_MSB),.intr_alloc_flags = 0,// default interrupt priority
.dma_buf_count = 8,.dma_buf_len = 64,.use_apll = false
};
i2s_driver_install(I2S_PORT,&i2s_config,NULL);
}
void i2s_setpin(){
const i2s_pin_config_t pin_config = {
.bck_io_num = I2S_SCK,.ws_io_num = I2S_WS,.data_out_num = -1,.data_in_num = I2S_SD
};
i2s_set_pin(I2S_PORT,&pin_config);
}
错误:
Arduino: 1.8.15 (Windows 10),Board: "Adafruit Feather HUZZAH ESP8266,80 MHz,Flash,disabled (new aborts on oom),disabled,All SSL ciphers (most compatible),32KB cache + 32KB IRAM (balanced),Use pgm_read macros for IRAM/PROGMEM,4MB (FS:2MB OTA:~1019KB),v2 Lower Memory,None,Only Sketch,115200"
neuerVersuch_i2smic:1:10: Fatal error: driver/I2S.h: No such file or directory
1 | #include <driver/I2S.h>
| ^~~~~~~~~~~~~~
compilation terminated.
exit status 1
driver/I2S.h: No such file or directory
2.)
草图:
#include <I2S.h>
#define I2S_WS 5
#define I2S_SD 4
#define I2S_SCK 14
#define I2S_PORT I2S_NUM_0
void setup() {
// put your setup code here,115200"
D:\Dateien\Uni\Semesterprojekte\04 Talk to me\huzzah testing\neuerVersuch_i2smic\neuerVersuch_i2smic.ino: In function 'void i2s_install()':
neuerVersuch_i2smic:22:8: error: 'i2s_config_t' does not name a type
22 | const i2s_config_t i2s_config = {
| ^~~~~~~~~~~~
neuerVersuch_i2smic:6:18: error: 'I2S_NUM_0' was not declared in this scope
6 | #define I2S_PORT I2S_NUM_0
| ^~~~~~~~~
D:\Dateien\Uni\Semesterprojekte\04 Talk to me\huzzah testing\neuerVersuch_i2smic\neuerVersuch_i2smic.ino:34:22: note: in expansion of macro 'I2S_PORT'
34 | i2s_driver_install(I2S_PORT,NULL);
| ^~~~~~~~
neuerVersuch_i2smic:34:33: error: 'i2s_config' was not declared in this scope
34 | i2s_driver_install(I2S_PORT,NULL);
| ^~~~~~~~~~
neuerVersuch_i2smic:34:3: error: 'i2s_driver_install' was not declared in this scope
34 | i2s_driver_install(I2S_PORT,NULL);
| ^~~~~~~~~~~~~~~~~~
D:\Dateien\Uni\Semesterprojekte\04 Talk to me\huzzah testing\neuerVersuch_i2smic\neuerVersuch_i2smic.ino: In function 'void i2s_setpin()':
neuerVersuch_i2smic:38:8: error: 'i2s_pin_config_t' does not name a type
38 | const i2s_pin_config_t pin_config = {
| ^~~~~~~~~~~~~~~~
neuerVersuch_i2smic:6:18: error: 'I2S_NUM_0' was not declared in this scope
6 | #define I2S_PORT I2S_NUM_0
| ^~~~~~~~~
D:\Dateien\Uni\Semesterprojekte\04 Talk to me\huzzah testing\neuerVersuch_i2smic\neuerVersuch_i2smic.ino:45:15: note: in expansion of macro 'I2S_PORT'
45 | i2s_set_pin(I2S_PORT,&pin_config);
| ^~~~~~~~
neuerVersuch_i2smic:45:26: error: 'pin_config' was not declared in this scope
45 | i2s_set_pin(I2S_PORT,&pin_config);
| ^~~~~~~~~~
neuerVersuch_i2smic:45:3: error: 'i2s_set_pin' was not declared in this scope; did you mean 'i2s_setpin'?
45 | i2s_set_pin(I2S_PORT,&pin_config);
| ^~~~~~~~~~~
| i2s_setpin
exit status 1
'i2s_config_t' does not name a type
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。