0

我在这一点上迷路了,不胜感激!我从旧的 GitHub 下载了这个库,但我什至无法编译它。

Arduino: 1.6.6 Hourly Build 2015/10/14 10:42 (Windows 8.1), Board: "ATtiny 

x5 series, ATtiny85, 8 mhz (internal), B.O.D. Disabled"

Warning: platform.txt from core 'Arduino SAMD (32-bits ARM Cortex-M0+) Boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
Warning: platform.txt from core 'ATtiny Classic' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
In file included from C:\Users\Luke Bouchard\Documents\Arduino\libraries\ShiftPWM-master/ShiftPWM.h:25:0,

                 from C:\Users\Luke Bouchard\Documents\Arduino\test\test.ino:13:

C:\Users\Luke Bouchard\Documents\Arduino\libraries\ShiftPWM-master/pins_arduino_compile_time.h:318:3: error: 'PORTC' was not declared in this scope

  &PORTC,

   ^

C:\Users\Luke Bouchard\Documents\Arduino\libraries\ShiftPWM-master/pins_arduino_compile_time.h:319:3: error: 'PORTD' was not declared in this scope

  &PORTD,

   ^

exit status 1
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
4

1 回答 1

0

看起来您的库不支持 ATTINY85 芯片。

为了使代码与 ATTINY 兼容,我必须对库进行以下更改...

  • 减小代码大小以适应 ATTINY 有限的 FLASH 空间。
  • 消除对 SPI 和串行硬件的所有依赖,因为 ATTINY 没有它们。
  • 使用现有的 Timer0 中断来触发刷新,因为 ATTINY 的定时器较少。
  • 为 ATTINY 定义引脚和设备映射。

我还做了一些美学上的改变,比如在编译时静态分配缓冲区,因为没有串行连接就无法看到“内存不足”错误。

分叉在这里... https://github.com/bigjosh/ShiftPWM-Redux

自述文件包含有关对代码进行必要更改以从旧库移动到新库的信息(不难)。fork 中的示例也已更新以与新库一起使用,因此是一个很好的起点。

于 2015-12-16T22:25:21.957 回答