0

Trinket and WS2801 Strip
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket and WS2801 Strip

by namiller on Sat Dec 19, 2015 3:37 am

Hi there,

I'm hoping to connect a Trinket 5V to a strand of WS2801 RGB LEDs. When I simply try to run the strandtest example from the WS2801 with the Trinket I get an SPI error. I have tried running the WS2801 using the LDP8806 library on the Trinket and while I can get the code to run, all the pixels are really washed out. Instead of red, I have a very slightly pink, etc. This problem has been reported before, but I'm not sure if there is a solution (http://forums.adafruit.com/viewtopic.php?f=47&t=44122). I've been flailing around a bit and tried the Dotstar library and its initial strandtest example, along with specifying the use of a Trinket (by commenting out SPI and including <avr/power.h>). This is able to give the pixels good color, but leaves the first pixel unlit. Commenting out SPI and adding <avr/power.h> does not work within the WS2801 library it seems.

So, is there a means of running WS2801 RGB LEDs strips on a Trinket 5V? I'm trying to do a very short strand (6 pixels), but had the strip laying around and love the ease and the diffuse color of them. I am tight on space so I would love to use the Trinket 5V rather than the Pro Trinket. Any tricks out there for making this work and getting the colors right?

Thanks for any assistance,
Nate

namiller
 
Posts: 12
Joined: Tue Jan 14, 2014 3:10 pm

Re: Trinket and WS2801 Strip

by adafruit_support_mike on Sun Dec 20, 2015 3:19 am

Post the exact errors you're getting and we'll see what we can find. The library has been modified for Trinket support, so let's check to see what's going wrong.

adafruit_support_mike
 
Posts: 59156
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and WS2801 Strip

by namiller on Tue Dec 22, 2015 10:33 am

Thank you.
The error list is rather long (below) and appears to reference particular variables not being declared in a particular scope. These variables (SPSR, etc) are not in my actual code, so I assume they are from one of the libraries loaded. The only libraries I have included are #include "Adafruit_WS2801.h" and #include <avr/power.h>. I have commented out the SPI library (because this is on a Trinket 5V), but I get similar errors if I included. Any thoughts on this?

Thank you,

Nate

Code: Select all | TOGGLE FULL SIZE
Arduino: 1.6.6 (Mac OS X), Board: "Adafruit Trinket 16MHz"

/Applications/Arduino 1.6.6.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino 1.6.6.app/Contents/Java/hardware" -hardware "/Users/nmiller/Library/Arduino15/packages" -hardware "/Users/nmiller/Documents/Arduino/hardware" -tools "/Applications/Arduino 1.6.6.app/Contents/Java/tools-builder" -tools "/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr" -tools "/Users/nmiller/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino 1.6.6.app/Contents/Java/libraries" -libraries "/Users/nmiller/Documents/Arduino/libraries" -fqbn=adafruit:avr:trinket5 -ide-version=10606 -build-path "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/arduino_6a1313eb0ec5bcf3547123bf8c2dde4e/strandtest.pde"
/Applications/Arduino 1.6.6.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino 1.6.6.app/Contents/Java/hardware" -hardware "/Users/nmiller/Library/Arduino15/packages" -hardware "/Users/nmiller/Documents/Arduino/hardware" -tools "/Applications/Arduino 1.6.6.app/Contents/Java/tools-builder" -tools "/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr" -tools "/Users/nmiller/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino 1.6.6.app/Contents/Java/libraries" -libraries "/Users/nmiller/Documents/Arduino/libraries" -fqbn=adafruit:avr:trinket5 -ide-version=10606 -build-path "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/arduino_6a1313eb0ec5bcf3547123bf8c2dde4e/strandtest.pde"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI" "/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/tools-builder/ctags/5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/preproc/ctags_target.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/tools-builder/ctags/5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/preproc/ctags_target.cpp"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp" -o "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/sketch/strandtest.pde.cpp.o"
"/Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_TRINKET5 -DARDUINO_ARCH_AVR   "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/nmiller/Library/Arduino15/packages/adafruit/hardware/avr/1.4.1/variants/tiny8" "-I/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI" "-I/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801" "/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp" -o "/var/folders/sy/t42p3qkn5ddckw_9ztqdy2000000gn/T/build6a1313eb0ec5bcf3547123bf8c2dde4e.tmp/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp.o"
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In member function 'void SPISettings::init_AlwaysInline(uint32_t, uint8_t, uint8_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:146:16: error: 'SPE' was not declared in this scope
     spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
                ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:146:27: error: 'MSTR' was not declared in this scope
     spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
                           ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:146:65: error: 'DORD' was not declared in this scope
     spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
                                                                 ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::beginTransaction(SPISettings)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:203:5: error: 'SPCR' was not declared in this scope
     SPCR = settings.spcr;
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:204:5: error: 'SPSR' was not declared in this scope
     SPSR = settings.spsr;
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static uint8_t SPIClass::transfer(uint8_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:209:5: error: 'SPDR' was not declared in this scope
     SPDR = data;
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:217:14: error: 'SPSR' was not declared in this scope
     while (!(SPSR & _BV(SPIF))) ; // wait
              ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:217:25: error: 'SPIF' was not declared in this scope
     while (!(SPSR & _BV(SPIF))) ; // wait
                         ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static uint16_t SPIClass::transfer16(uint16_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:223:11: error: 'SPCR' was not declared in this scope
     if (!(SPCR & _BV(DORD))) {
           ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:223:22: error: 'DORD' was not declared in this scope
     if (!(SPCR & _BV(DORD))) {
                      ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:224:7: error: 'SPDR' was not declared in this scope
       SPDR = in.msb;
       ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:226:16: error: 'SPSR' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:226:27: error: 'SPIF' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                           ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:230:16: error: 'SPSR' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:230:27: error: 'SPIF' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                           ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:233:7: error: 'SPDR' was not declared in this scope
       SPDR = in.lsb;
       ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:235:16: error: 'SPSR' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:235:27: error: 'SPIF' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                           ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:239:16: error: 'SPSR' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:239:27: error: 'SPIF' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                           ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::transfer(void*, size_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:247:5: error: 'SPDR' was not declared in this scope
     SPDR = *p;
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:250:16: error: 'SPSR' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:250:27: error: 'SPIF' was not declared in this scope
       while (!(SPSR & _BV(SPIF))) ;
                           ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:255:14: error: 'SPSR' was not declared in this scope
     while (!(SPSR & _BV(SPIF))) ;
              ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:255:25: error: 'SPIF' was not declared in this scope
     while (!(SPSR & _BV(SPIF))) ;
                         ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::setBitOrder(uint8_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:292:31: error: 'SPCR' was not declared in this scope
     if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);
                               ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:292:43: error: 'DORD' was not declared in this scope
     if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);
                                           ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:293:10: error: 'SPCR' was not declared in this scope
     else SPCR &= ~(_BV(DORD));
          ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:293:24: error: 'DORD' was not declared in this scope
     else SPCR &= ~(_BV(DORD));
                        ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::setDataMode(uint8_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:298:5: error: 'SPCR' was not declared in this scope
     SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::setClockDivider(uint8_t)':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:303:5: error: 'SPCR' was not declared in this scope
     SPCR = (SPCR & ~SPI_CLOCK_MASK) | (clockDiv & SPI_CLOCK_MASK);
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:304:5: error: 'SPSR' was not declared in this scope
     SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((clockDiv >> 2) & SPI_2XCLOCK_MASK);
     ^
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:309:42: error: 'SPCR' was not declared in this scope
   inline static void attachInterrupt() { SPCR |= _BV(SPIE); }
                                          ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:309:54: error: 'SPIE' was not declared in this scope
   inline static void attachInterrupt() { SPCR |= _BV(SPIE); }
                                                      ^
In file included from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:0:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:310:42: error: 'SPCR' was not declared in this scope
   inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }
                                          ^
In file included from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:17,
                 from /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:1:
/Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI/SPI.h:310:55: error: 'SPIE' was not declared in this scope
   inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }
                                                       ^
/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp: In member function 'void Adafruit_WS2801::show()':
/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:141:7: error: 'SPDR' was not declared in this scope
       SPDR = pixels[i];
       ^
/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:142:15: error: 'SPSR' was not declared in this scope
       while(!(SPSR & (1<<SPIF)));
               ^
/Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.cpp:142:26: error: 'SPIF' was not declared in this scope
       while(!(SPSR & (1<<SPIF)));
                          ^
Using library Adafruit_WS2801 in folder: /Users/nmiller/Documents/Arduino/libraries/Adafruit_WS2801 (legacy)
Using library SPI at version 1.0 in folder: /Applications/Arduino 1.6.6.app/Contents/Java/hardware/arduino/avr/libraries/SPI
exit status 1
Error compiling.
Last edited by adafruit_support_mike on Thu Dec 24, 2015 1:56 am, edited 1 time in total.
Reason: added CODE tags

namiller
 
Posts: 12
Joined: Tue Jan 14, 2014 3:10 pm

Re: Trinket and WS2801 Strip

by adafruit_support_mike on Thu Dec 24, 2015 1:58 am

Try dropping back from version 1.6.6 of the Arduino IDE to 1.6.5.

The latest version changed some precompiler settings and broke a ton of existing code. We suggest sticking with 1.6.5 until the dust settles.

adafruit_support_mike
 
Posts: 59156
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and WS2801 Strip

by Therev on Tue Jun 11, 2019 10:48 pm

I'm having issues trying to use Trinket with the WS2801 20 pixel string.
The error I get is:

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Adafruit Trinket (ATtiny85 @ 8MHz)"

Build options changed, rebuilding all
In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In member function 'void SPISettings::init_AlwaysInline(uint32_t, uint8_t, uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:16: error: 'SPE' was not declared in this scope

spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:27: error: 'MSTR' was not declared in this scope

spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:65: error: 'DORD' was not declared in this scope

spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::beginTransaction(SPISettings)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:203:5: error: 'SPCR' was not declared in this scope

SPCR = settings.spcr;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:204:5: error: 'SPSR' was not declared in this scope

SPSR = settings.spsr;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static uint8_t SPIClass::transfer(uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:209:5: error: 'SPDR' was not declared in this scope

SPDR = data;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:14: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ; // wait

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:25: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ; // wait

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static uint16_t SPIClass::transfer16(uint16_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:223:11: error: 'SPCR' was not declared in this scope

if (!(SPCR & _BV(DORD))) {

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:223:22: error: 'DORD' was not declared in this scope

if (!(SPCR & _BV(DORD))) {

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:224:7: error: 'SPDR' was not declared in this scope

SPDR = in.msb;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:226:16: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:226:27: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:230:16: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:230:27: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:233:7: error: 'SPDR' was not declared in this scope

SPDR = in.lsb;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:235:16: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:235:27: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:239:16: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:239:27: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::transfer(void*, size_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:247:5: error: 'SPDR' was not declared in this scope

SPDR = *p;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:250:16: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:250:27: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:255:14: error: 'SPSR' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:255:25: error: 'SPIF' was not declared in this scope

while (!(SPSR & _BV(SPIF))) ;

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::setBitOrder(uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:292:31: error: 'SPCR' was not declared in this scope

if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:292:43: error: 'DORD' was not declared in this scope

if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:293:10: error: 'SPCR' was not declared in this scope

else SPCR &= ~(_BV(DORD));

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:293:24: error: 'DORD' was not declared in this scope

else SPCR &= ~(_BV(DORD));

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::setDataMode(uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:298:5: error: 'SPCR' was not declared in this scope

SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::setClockDivider(uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:303:5: error: 'SPCR' was not declared in this scope

SPCR = (SPCR & ~SPI_CLOCK_MASK) | (clockDiv & SPI_CLOCK_MASK);

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:304:5: error: 'SPSR' was not declared in this scope

SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((clockDiv >> 2) & SPI_2XCLOCK_MASK);

^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:309:42: error: 'SPCR' was not declared in this scope

inline static void attachInterrupt() { SPCR |= _BV(SPIE); }

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:309:54: error: 'SPIE' was not declared in this scope

inline static void attachInterrupt() { SPCR |= _BV(SPIE); }

^

In file included from C:\Users\revje\OneDrive\Documents\Arduino\newtest\newtest.ino:2:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:310:42: error: 'SPCR' was not declared in this scope

inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\newtest.ino.cpp:1:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\libraries\SPI\src/SPI.h:310:55: error: 'SPIE' was not declared in this scope

inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }

^

Multiple libraries were found for "Adafruit_WS2801.h"
Used: C:\Users\revje\OneDrive\Documents\Arduino\libraries\Adafruit_WS2801_Library
Not used: C:\Users\revje\OneDrive\Documents\Arduino\libraries\Adafruit-WS2801-Library-master
exit status 1
Error compiling for board Adafruit Trinket (ATtiny85 @ 8MHz).

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

Therev
 
Posts: 2
Joined: Tue Jun 11, 2019 10:46 pm

Re: Trinket and WS2801 Strip

by oesterle on Wed Jun 12, 2019 2:47 am

Hi, Therev!

Welcome to the Adafruit Forums!

You're in the right area, but please start a new thread for your issue; you're much more likely to get help that way. The best pattern on the Adafruit forums tends to be focusing on a single person's project in each thread. The thread you're replying to is also over 3 years old, making your comment less likely to be noticed.

Please turn on "Show verbose output during compilation" in the Arduino IDE. It's under File > Preferences.

One more thing: when pasting your code or errors, please then highlight the code, and use the CODE button to format it nicely. It's totally OK if it's long – the forum will take care of making it scrollable/expandable. Long error messages are helpful and give us more info.

Thanks for reading through all of this!

Cheers,

Eric

oesterle
 
Posts: 654
Joined: Tue Sep 17, 2013 11:32 pm

Re: Trinket and WS2801 Strip

by Therev on Thu Jun 13, 2019 2:30 am

Follow up: In case others find the same things as me:

Solution was here: viewtopic.php?f=47&t=36676&p=180865

It linked to the libraries here: https://github.com/doublejosh/Simple_WS2801

Therev
 
Posts: 2
Joined: Tue Jun 11, 2019 10:46 pm

Re: Trinket and WS2801 Strip

by oesterle on Thu Jun 13, 2019 2:07 pm

Interesting read! Thanks for adding the links to your solution.

I just helped out a friend with an old school Adafruit GEMMA, on which he was running out of memory using a short NeoPixel RGBW strip. I pointed him at the Adafruit GEMMA M0, which has 64x the memory of the original GEMMA. And it's the same price!

Similarly, Trinket is available in an M0 version, for just $2 more. Although, I haven't tried an M0 with WS2801 LEDs. On my current projects, I mostly use NeoPixel (WS2812B) and DotStar LEDs (APA102C).

All that said, I still enjoy the challenge and wonder of coding for very, very constrained platforms like the ATtiny85 at the heart of your Trinket, and occasionally need to use them.

oesterle
 
Posts: 654
Joined: Tue Sep 17, 2013 11:32 pm

Please be positive and constructive with your questions and comments.