I just received my prop shield with IMU and Teensy 3.2 and I've encountered a strange, repeatable hang using the FastLED library. I am using the "FirstLight" sketch with the examples provided by Paul on the main page to raise pin 7. When powered by USB, the whole teensy freezes after about 5 seconds. (Powered by a 3.7V lipo 2000mah, this freeze does not happen.) The only connections are the four leads to the APA102 array. Its a hard freeze - serial monitor, USB, etc all seem to hang. I am only driving 30 LEDs. Host is a MPB 15" with USB directly connected.
Things i have tried:
- Adding in transactions with SPI and varying the speed from 24000000 to others
- Changing teensy processor speed
- Resoldering the pins
- Different USB cables
- Forcing pins 5,6 LOW to take the memory chip out of the SPI bus
- Monitoring voltage on the strip with a voltmeter (its rock solid at 4.99V the whole time.)
- Completely reinstalling Arduino + teensyloader.
I cannot reproduce this with the Adafruit dotstar libraries, however they appear to be somewhat incompatable with some of the other things I want to eventually test attach to the prop shield. My project needs a speaker, rotary encoder, IMU, and some sort of LED display in addition to the APA102s. My experience when I wired all of this up originally was that using the adafruit library seemed to prevent the ssd1351 libraries from interfacing properly once i had the full project wired up, thus the use of FastLEd, and thus the discovery of a hang.
My concern is that i have a hardware problem I cannot identify, and thus I'm worried. I'm trying to integrate a few different things together in one project and its concerning to have a wildcard in the mix.
I am using a freshly installed 1.29 teensy installer.
Things i have tried:
- Adding in transactions with SPI and varying the speed from 24000000 to others
- Changing teensy processor speed
- Resoldering the pins
- Different USB cables
- Forcing pins 5,6 LOW to take the memory chip out of the SPI bus
- Monitoring voltage on the strip with a voltmeter (its rock solid at 4.99V the whole time.)
- Completely reinstalling Arduino + teensyloader.
I cannot reproduce this with the Adafruit dotstar libraries, however they appear to be somewhat incompatable with some of the other things I want to eventually test attach to the prop shield. My project needs a speaker, rotary encoder, IMU, and some sort of LED display in addition to the APA102s. My experience when I wired all of this up originally was that using the adafruit library seemed to prevent the ssd1351 libraries from interfacing properly once i had the full project wired up, thus the use of FastLEd, and thus the discovery of a hang.
My concern is that i have a hardware problem I cannot identify, and thus I'm worried. I'm trying to integrate a few different things together in one project and its concerning to have a wildcard in the mix.
I am using a freshly installed 1.29 teensy installer.
Code:
#include <FastLED.h>
#include <SPI.h>
#define NUM_LEDS 30
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(57600 );
FastLED.addLeds<APA102, BGR>(leds, NUM_LEDS);
FastLED.setBrightness(10);
pinMode( 7, OUTPUT );
digitalWrite( 7, LOW );
pinMode( 6, OUTPUT );
digitalWrite( 6, LOW );
pinMode( 5, OUTPUT );
digitalWrite( 5, LOW );
}
void loop() {
// Move a single white led
for(int n = 0; n < NUM_LEDS; n++) {
leds[n] = CRGB::White;
// beginTransaction prevents SPI bus conflicts
SPI.beginTransaction(SPISettings(24000000, MSBFIRST, SPI_MODE0));
digitalWrite(7, HIGH); // enable access to LEDs
FastLED.show();
digitalWrite(7, LOW);
SPI.endTransaction(); // allow other libs to use SPI again
delay(6);
leds[n] = CRGB::Black;
}
Serial.println( millis() );
}