C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino: In function 'void loop()': C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:43:31: error: 'SCL_TIME' was not declared in this scope PrintVector(vReal, samples, SCL_TIME); ^~~~~~~~ C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:51:31: error: 'SCL_INDEX' was not declared in this scope PrintVector(vReal, samples, SCL_INDEX); ^~~~~~~~~ C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:57:38: error: 'SCL_FREQUENCY' was not declared in this scope PrintVector(vReal, (samples >> 1), SCL_FREQUENCY); ^~~~~~~~~~~~~ C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino: In function 'void PrintVector(double*, uint16_t, uint8_t)': C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:86:10: error: 'SCL_INDEX' was not declared in this scope case SCL_INDEX: ^~~~~~~~~ C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:89:10: error: 'SCL_TIME' was not declared in this scope case SCL_TIME: ^~~~~~~~ C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:92:10: error: 'SCL_FREQUENCY' was not declared in this scope case SCL_FREQUENCY: ^~~~~~~~~~~~~ C:\Users\ycy13\AppData\Local\Temp\.arduinoIDE-unsaved2023615-27376-1dcww8o.35b\sketch_jul15a\sketch_jul15a.ino:97:22: error: 'SCL_FREQUENCY' was not declared in this scope if (scaleType == SCL_FREQUENCY) ^~~~~~~~~~~~~ exit status 1 Compilation error: 'SCL_TIME' was not declared in this scope
时间: 2023-08-11 19:07:06 浏览: 165
UIPEthernet:Arduino IDE 的 UIPEthernet 库、带有 arduino 插件的 Eclipse 和 MBEDSMeshStudio(AVR、STM32F、ESP8266、Intel ARC32、Nordic nRF51、Teensy 板、Realtek Ameba(RTL8195A、RTL8710))、ENC28j60 网络芯片。 兼容 Wiznet W5100 以太网库 API
根据你提供的错误信息,看起来是因为少对应的常量定义导致编译错误。在代码中使用了 `SCL_TIME`、`SCL_INDEX` 和 `SCL_FREQUENCY`,但这些常量没有在代码中定义。
为了解决这个问题,你需要在代码中添加这些常量的定义。根据你的需求,你可以将以下常量定义添加到代码的开头:
```c++
#define SCL_TIME 0x01
#define SCL_INDEX 0x02
#define SCL_FREQUENCY 0x03
```
这样,编译器就能够识别并正确处理这些常量了。
请注意,根据你的具体需求,你也可以自定义这些常量的值。只要确保常量定义与其在代码中的使用一致即可。
希望这个修改能够解决你的问题!如果你还有其他疑问,请随时提问。
阅读全文