PlatformIO 控制台打印 'xxx' was not declared in this scope
PlatformIO定义的方法提示’xxx’ was not declared in this scope
把网上下载来的代码直接复制进PlatformIO里编译报错提示“attackDecayWave8 was not declared in this scope” 也就是说未定义 可我代码里明明有定义过这个方法甚至在vscode能跳转过去,而且在Arduino的ide中可以正常编译上传
一番操作之后终于找到了答案:之前写arduino代码是写在xxx.ino 中 而PlatformIO中我们的代码写在 main.ccp里 而 .cpp文件中代码严格遵循iso cpp规范 函数必须先声明后调用
解决方法
把方法定义在调用之前