0

I'm lost at this point and would appreciate any help! I downloaded this library from an old GitHub and I can't even compile it.

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.
lukeb28
  • 179
  • 1
  • 2
  • 12

1 Answers1

0

It looks like your library does not support the ATTINY85 chip.

To make the code compatible with the ATTINY, I had to make the following changes to the library...

  • Reduce the code size to fit inside the ATTINY limited FLASH space.
  • Eliminate all dependencies on SPI and Serial hardware since ATTINY doesn't have them.
  • Use the existing Timer0 interrupt for refresh triggers since the ATTINY has fewer timers.
  • Define pin and device mapping for the ATTINY.

I also made some aesthetic changes like having the buffer statically allocated at compile time since without a Serial connection there would be no way to see the "out of memory" error.

The fork is here... https://github.com/bigjosh/ShiftPWM-Redux

The readme includes information on necessary changes to your code to move from the old library to the new one (not hard). The examples in the fork are also updated to work with the new library so are a good start point.

bigjosh
  • 1,273
  • 13
  • 19
  • The author seems long gone. How would I go about doing this myself? – lukeb28 Dec 17 '15 at 04:37
  • Could you use an ATMEGA rather than an ATTINY? Could you use NeoPixels rather than shift-based LED strips? – bigjosh Dec 17 '15 at 14:47
  • ATTiny85 is all I have ATM – lukeb28 Dec 17 '15 at 15:01
  • I looked into it and it would likely take a couple of hours to rework this library to work with an ATTNY85 since the code has lots of dependencies on hardware that the ATTINY85 just doesn't have like Serial, SPI, and Timers #2 and #3. There is no fundamental reason why you would not be able to get this code to work on the ATTINY85, it would just take effort. – bigjosh Dec 18 '15 at 03:18
  • So do I just remove all the code that looks for these things? – lukeb28 Dec 18 '15 at 13:55
  • It is harder than that. The current library is too big to fit in an ATTINY codespace. It also depends on having an extra timer. I'm working on a port now. I think I can post a github fork that supports ATTINY shortly. – bigjosh Dec 18 '15 at 19:13
  • Here is a [fork I made](https://github.com/bigjosh/ShiftPWM-Redux) that should work on ATTINY85. I do not have any shift registers to test it on, so let me know if it works. Thanks. – bigjosh Dec 19 '15 at 01:55
  • Thanks! I'm not is a position to test it right now but I will be in a day. I'll let you know how it goes! – lukeb28 Dec 20 '15 at 17:37