Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: adafruit NeoPixel library will not compile with teensy 3.1

  1. #1
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253

    adafruit NeoPixel library will not compile with teensy 3.1

    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\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp: In member function 'void Adafruit_NeoPixel::show()':
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:764:3: error: 'Pio' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:764:19: error: 'port' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:765:12: error: 'WoReg' does not name a type
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:768:29: error: 'pmc_set_writeprotect' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:769:35: error: 'TC3_IRQn' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:769:43: error: 'pmc_enable_periph_clk' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:770:16: error: 'TC1' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:771:5: error: 'TC_CMR_WAVE' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:771:19: error: 'TC_CMR_WAVSEL_UP' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:771:38: error: 'TC_CMR_TCCLKS_TIMER_CLOCK1' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:771:64: error: 'TC_Configure' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:772:18: error: 'TC_Start' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:774:15: error: 'g_APinDescription' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:776:3: error: 'portSet' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:777:3: error: 'portClear' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:778:3: error: 'timeValue' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:779:3: error: 'timeReset' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:786:14: error: 'VARIANT_MCK' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:790:14: error: 'VARIANT_MCK' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:799:18: error: 'TC_CCR_CLKEN' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:799:33: error: 'TC_CCR_SWTRG' was not declared in this scope
    C:\Users\Turner\Documents\Arduino\libraries\Adafru it_NeoPixel\Adafruit_NeoPixel.cpp:809:17: error: 'TC_Stop' was not declared in this scope

  2. #2
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253
    In Adafruit_Neopixel.cpp I suspect I need to change this #ifdef __MK20DX128__ // Teensy 3.0 but to what?

  3. #3
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253
    Replaced with #ifdef __MK20DX256__ // Teensy 3.0 in two locations. Will compile but not run. Loaded strandtest with same behavior.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,351
    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.

  5. #5
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253
    Thanks, no hurry

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,351
    Ok, I think I've got adafruit NeoPixel working now. Here's the code:

    https://github.com/PaulStoffregen/Adafruit_NeoPixel

    I tested with a short strip and an oscilloscope, using both Teensy 3.0 and 3.1.

    Please let me know this works for you?

  7. #7
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253
    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.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,351
    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?

  9. #9
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253
    Click image for larger version. 

Name:	VIN 5.3 volt.JPG 
Views:	172 
Size:	290.5 KB 
ID:	1208Click image for larger version. 

Name:	VIN 4.0 volt.JPG 
Views:	211 
Size:	290.8 KB 
ID:	1207

    Looks good at both voltage levels. Starting to suspect the problem is the neopixel strip.

  10. #10
    Senior Member
    Join Date
    Oct 2013
    Location
    Rogersville MO
    Posts
    253
    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.

  11. #11
    Junior Member
    Join Date
    Jan 2014
    Location
    New York, NY
    Posts
    2
    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!

  12. #12
    Junior Member
    Join Date
    Jan 2014
    Posts
    8
    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'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •