adafruit NeoPixel library will not compile with teensy 3.1

Status
Not open for further replies.

cartere

Well-known member
Trying to run the "Fun with FFT" code on Teensy 3.1 works fine with 3.0. I get lots of errors related to the NeoPixel library.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Windows 7), Board: "Teensy 3.1"
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp: In member function 'void Adafruit_NeoPixel::show()':
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:764:3: error: 'Pio' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:764:19: error: 'port' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:765:12: error: 'WoReg' does not name a type
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:768:29: error: 'pmc_set_writeprotect' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:769:35: error: 'TC3_IRQn' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:769:43: error: 'pmc_enable_periph_clk' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:770:16: error: 'TC1' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:771:5: error: 'TC_CMR_WAVE' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:771:19: error: 'TC_CMR_WAVSEL_UP' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:771:38: error: 'TC_CMR_TCCLKS_TIMER_CLOCK1' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:771:64: error: 'TC_Configure' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:772:18: error: 'TC_Start' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:774:15: error: 'g_APinDescription' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:776:3: error: 'portSet' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:777:3: error: 'portClear' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:778:3: error: 'timeValue' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:779:3: error: 'timeReset' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:786:14: error: 'VARIANT_MCK' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:790:14: error: 'VARIANT_MCK' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:799:18: error: 'TC_CCR_CLKEN' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:799:33: error: 'TC_CCR_SWTRG' was not declared in this scope
C:\Users\Turner\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:809:17: error: 'TC_Stop' was not declared in this scope
 
In Adafruit_Neopixel.cpp I suspect I need to change this #ifdef __MK20DX128__ // Teensy 3.0 but to what?
 
Replaced with #ifdef __MK20DX256__ // Teensy 3.0 in two locations. Will compile but not run. Loaded strandtest with same behavior.
 
Oh.... now I'm remembering how I was going to rewrite the Teensy3 code in NeoPixel to not depend on the flash memory speed. ;)

Hold on just a bit. I've got some NeoPixels here and a plan. I'm pretty sure I know what's wrong. Should have a fix later today.
 
Works after a fashion. With Teensy 3.0 I can vary the input voltage from about 2.5v to 5.5v and the neopixel 8 led strip is rock solid running strandtest. With Teensy 3.1 the strip will not reliably start at 4.99v ( from USB port ) when it does start it flickers and is unstable, with voltage under 4.9v ( from power supply) output is rock solid down to under 2.5v. I usually run strips using a 3.7v lipo battery so this will not generally be a problem. It would be nice if short strips would run off the USB power, otherwise it looks like I will need a level shifter to run at 5v.
 
I don't know what's going on with the power. It ought to be very similar between the 2 boards, but obviously sometime is different. Do you have a scope?
 
VIN 5.3 volt.JPGVIN 4.0 volt.JPG

Looks good at both voltage levels. Starting to suspect the problem is the neopixel strip.
 
Did a comparison between the two boards, both acting the same now. I am wondering if the issue might involve the neopixels warming up? Does not seem to be a Teensy problem.
 
Used 3.0 and NeoPIxels were working wonderfully, added Teensy Loader 1.17 to support the 3.1 and some things started to happen. I was getting the compile error for 3.1 similar to what you originally posted, and that was solved with updates, however after changing out the .cpp / .h for the NeoPixel LIbrary I'm having some other problems.
Both 3 & 3.1 freeze/crash during operation if I try to include the "pixels.show();" command at any point in the code - all of the other code seems to work properly, and even when included there are zero errors showing in the compiler. I am using Arduino 1.0.5, Teensy Loader 1.17, on 64 bit Windows 7 Home Premium w/SP1. I have tried running the code with the Pixels disconnected from the MCU as well, and still freeze/crash seems to occur. I have also tried both Paul's NeoPixel files from Github, as well as Adafruits NeoPixel files from Github. There seems to be some small differences, but neither is working in full.

Suggestions?

I would love to just roll back to 3.0, but I need the RAM in the 3.1 to do some audio processing...Thanks!
 
Hello, I'm using Teensy Loader 1.18 on Teensy 3.1 and I'm also having compilation errors with the NeoPixel Library which I've copied and pasted below. Also, is it possible to port over the setBrightness function as well? I don't need the pixels that bright and I"m trying to conserve power as I'm just using a 3.7 LiPo battery. Thanks!

Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.1"
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=117 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 -I/Users/Robert/Documents/Arduino/libraries/AdafruitGFX -I/Users/Robert/Documents/Arduino/libraries/Adafruit_NeoMatrix -I/Users/Robert/Documents/Arduino/libraries/Adafruit_NeoPixel /var/folders/oK/oKGjE4z3GumG4MPVaxRSyE+++TQ/-Tmp-/build6933252362980668066.tmp/matrixtest.cpp -o /var/folders/oK/oKGjE4z3GumG4MPVaxRSyE+++TQ/-Tmp-/build6933252362980668066.tmp/matrixtest.cpp.o
In file included from matrixtest.pde:6:0:
/Users/Robert/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.h:34:7: error: redefinition of 'class Adafruit_NeoPixel'
In file included from /Users/Robert/Documents/Arduino/libraries/Adafruit_NeoMatrix/Adafruit_NeoMatrix.h:29:0,
from matrixtest.pde:5:
/Users/Robert/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.h:34:7: error: previous definition of 'class Adafruit_NeoPixel'
 
Status
Not open for further replies.
Back
Top