Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Millis() runs slow with t3.6 running 16ch parallel out example #902

Open
ryanelm opened this issue Oct 17, 2019 · 0 comments
Open

Millis() runs slow with t3.6 running 16ch parallel out example #902

ryanelm opened this issue Oct 17, 2019 · 0 comments

Comments

@ryanelm
Copy link

ryanelm commented Oct 17, 2019

The code below outputs the FPS every second, however on a teensy 3.6 running at 180MHZ it takes ~4 seconds. tested on several boards. Also tried elapsedMillis type but it is also slow.

`#include <FastLED.h>

#define NUM_LEDS_PER_STRIP 1024
// Note: this can be 12 if you're using a teensy 3 and don't mind soldering the pads on the back
#define NUM_STRIPS 16

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

// Pin layouts on the teensy 3/3.1:
// WS2811_PORTD: 2,14,7,8,6,20,21,5
// WS2811_PORTC: 15,22,23,9,10,13,11,12,28,27,29,30 (these last 4 are pads on the bottom of the teensy)
// WS2811_PORTDC: 2,14,7,8,6,20,21,5,15,22,23,9,10,13,11,12 - 16 way parallel
//
// Pin layouts on the due
// WS2811_PORTA: 69,68,61,60,59,100,58,31 (note: pin 100 only available on the digix)
// WS2811_PORTB: 90,91,92,93,94,95,96,97 (note: only available on the digix)
// WS2811_PORTD: 25,26,27,28,14,15,29,11
//

// IBCC<WS2811, 1, 16> outputs;

void setup() {
//delay(5000);
Serial.begin(57600);
Serial.println("Starting...");
// LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
// LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
// LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
LEDS.addLeds<WS2811_PORTDC, NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);

// Teensy 4 parallel output example
// LEDS.addLeds<NUM_STRIPS, WS2811, 1>(leds,NUM_LEDS_PER_STRIP);
}

int debugTime = 0;
int fps = 0;
void loop()
{
static int t = millis();
int dt = millis() - t;
t += dt;
debugTime += dt;

if (debugTime > 1000)
{
Serial.println(fps);
Serial.println(debugTime);
debugTime -= 1000;
fps = 0;
}
static uint8_t hue = 0;
static bool ind = true;
for (int i = 0; i < NUM_STRIPS; i++)
{
for (int j = 0; j < NUM_LEDS_PER_STRIP; j++)
{
leds[(i * NUM_LEDS_PER_STRIP) + j] = CHSV((32 * i) + hue + j, 192, 255);
}
}

// Set the first n leds on each strip to show which strip it is
for (int i = 0; i < NUM_STRIPS; i++) {
for (int j = 0; j <= i; j++) {
//leds[(i*NUM_LEDS_PER_STRIP) + j] = ind ? CRGB::Red : CRGB::Green;
}
}

hue++;
ind = !ind;
fps++;
LEDS.show();
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant