打扰了.我是一个刚入门的学生.编译时出错.很努力但...-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2944|回复: 4

[已解决] 打扰了.我是一个刚入门的学生.编译时出错.很努力但...

[复制链接]
发表于 2021-6-3 03:03 | 显示全部楼层 |阅读模式
打扰了,诸位老师.我是一个刚入门的学生.编译时出错.很努力在网络上寻找了4-5个小时的解决办法,但限于刚入门,还是小白,不明白.解决不了.但是老板又下命令让我在明天中午解决. T.T请大家帮帮我.详细信息如附件,
Arduino:1.8.15 (Windows 10), 开发板:"Arduino Uno"

正在编译项目...

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp: In member function 'void Adafruit_CircuitPlayground::playTone(uint16_t, uint16_t, bool)':

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:238:3: error: 'PLLFRQ' was not declared in this scope

   PLLFRQ = (PLLFRQ & 0xCF) | 0x30;   // Route PLL to async clk

   ^~~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:238:3: note: suggested alternative: 'PCIFR'

   PLLFRQ = (PLLFRQ & 0xCF) | 0x30;   // Route PLL to async clk

   ^~~~~~

   PCIFR

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:239:3: error: 'TCCR4A' was not declared in this scope

   TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

   ^~~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:239:3: note: suggested alternative: 'TCCR0A'

   TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

   ^~~~~~

   TCCR0A

In file included from g:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from g:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from G:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground/utility/Adafruit_CPlay_LIS3DH.h:30,

                 from G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:21,

                 from G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:30:

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:239:16: error: 'COM4A0' was not declared in this scope

   TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

                ^

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:239:16: note: suggested alternative: 'COM0A0'

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:239:30: error: 'PWM4A' was not declared in this scope

   TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

                              ^

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:239:30: note: suggested alternative: 'PWM'

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:240:3: error: 'TCCR4B' was not declared in this scope

   TCCR4B = _BV(PWM4X) | scalebits;   // PWM invert

   ^~~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:240:3: note: suggested alternative: 'TCCR0B'

   TCCR4B = _BV(PWM4X) | scalebits;   // PWM invert

   ^~~~~~

   TCCR0B

In file included from g:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from g:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from G:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground/utility/Adafruit_CPlay_LIS3DH.h:30,

                 from G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:21,

                 from G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:30:

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:240:16: error: 'PWM4X' was not declared in this scope

   TCCR4B = _BV(PWM4X) | scalebits;   // PWM invert

                ^

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:240:16: note: suggested alternative: 'PWM'

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:241:3: error: 'TCCR4D' was not declared in this scope

   TCCR4D = 0;                        // Fast PWM mode

   ^~~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:241:3: note: suggested alternative: 'TCCR0A'

   TCCR4D = 0;                        // Fast PWM mode

   ^~~~~~

   TCCR0A

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:242:3: error: 'TCCR4E' was not declared in this scope

   TCCR4E = 0;                        // Not enhanced mode

   ^~~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:242:3: note: suggested alternative: 'TCCR0A'

   TCCR4E = 0;                        // Not enhanced mode

   ^~~~~~

   TCCR0A

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:243:3: error: 'DT4' was not declared in this scope

   DT4 = 0;                           // No dead time

   ^~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:243:3: note: suggested alternative: 'DD4'

   DT4 = 0;                           // No dead time

   ^~~

   DD4

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:249:3: error: 'TC4H' was not declared in this scope

   TC4H = hi1;

   ^~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:249:3: note: suggested alternative: 'PC4'

   TC4H = hi1;

   ^~~~

   PC4

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:250:3: error: 'OCR4C' was not declared in this scope

   OCR4C = lo1; // TOP

   ^~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:250:3: note: suggested alternative: 'OCR2A'

   OCR4C = lo1; // TOP

   ^~~~~

   OCR2A

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:252:3: error: 'OCR4A' was not declared in this scope

   OCR4A = lo2; // 50% duty

   ^~~~~

G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:252:3: note: suggested alternative: 'OCR2A'

   OCR4A = lo2; // 50% duty

   ^~~~~

   OCR2A

使用 1.10.10  版本的库 Adafruit_GFX_Library 在文件夹: G:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library

使用 1.0  版本的库 SPI 在文件夹: G:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI

使用 1.11.3  版本的库 Adafruit_Circuit_Playground 在文件夹: G:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground

使用 1.0  版本的库 Wire 在文件夹: G:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire

使用 2.4.5  版本的库 Adafruit_SSD1306 在文件夹: G:\Program Files (x86)\Arduino\libraries\Adafruit_SSD1306

使用 1.7.3  版本的库 Adafruit_BusIO 在文件夹: G:\Program Files (x86)\Arduino\libraries\Adafruit_BusIO

exit status 1

为开发板 Arduino Uno 编译时出错。
库我更新到最新了.






报错.rar

2.72 KB, 下载次数: 5

发表于 2021-6-3 07:07 | 显示全部楼层
看一下,是这个板子吗?

https://learn.adafruit.com/intro ... playground/overview

如果是这个板子的话,你需要换 Leonardo 因为他核心是 32u4

Uno 核心的 328P ,二者的一些底层寄存器有差别
发表于 2021-6-3 09:09 | 显示全部楼层
同上,你用的lib不是给arduino UNO用的
 楼主| 发表于 2021-6-3 16:45 | 显示全部楼层
Zoologist 发表于 2021-6-3 07:07
看一下,是这个板子吗?

https://learn.adafruit.com/introducing-circuit-playground/overview

谢谢老师指点.  
我找到原因了,代码被 同 事 悄 悄 地 恶作剧修改了.我改回来就好了.
 楼主| 发表于 2021-6-3 16:47 | 显示全部楼层
奈何col 发表于 2021-6-3 09:09
同上,你用的lib不是给arduino UNO用的

谢谢老师指点.  
我找到原因了,代码被 同 事 悄 悄 地 恶作剧修改了.我改回来就好了.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-29 05:37 , Processed in 0.108140 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表