sunandmooncouture
New member
I have a Teensy 4.1 driving about a thousand WS2812 pixels via octoWS2811 library (4 outputs of 250 each).
The CPU is hitting 108 F. Is that normal? This is for a wearable so anything over body temp is a concern.
I have the entire Teensy heat shrink wrapped which I know doesn't help.
Teensy is powered by USB port, and LEDs are powered by 2 usb ports (500 leds per port) each port pulls about 2.2 amps so 4.4 amps total + whatever the teensy is pulling. The LED plugs are also getting hot, can anyone recommend a better plug than what I'm using? (see attachments)
Complete code if needed:
The CPU is hitting 108 F. Is that normal? This is for a wearable so anything over body temp is a concern.
I have the entire Teensy heat shrink wrapped which I know doesn't help.
Teensy is powered by USB port, and LEDs are powered by 2 usb ports (500 leds per port) each port pulls about 2.2 amps so 4.4 amps total + whatever the teensy is pulling. The LED plugs are also getting hot, can anyone recommend a better plug than what I'm using? (see attachments)
Complete code if needed:
Code:
#include <OctoWS2811.h>
const int numPins = 4;
byte pinList[numPins] = {0, 1, 13, 14};
const int ledsPerStrip = 250;
const int bytesPerLED = 3; // change to 4 if using RGBW
DMAMEM int displayMemory[ledsPerStrip * numPins * bytesPerLED / 4];
int drawingMemory[ledsPerStrip * numPins * bytesPerLED / 4];
const int config = WS2811_GRB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config, numPins, pinList);
int rainbowColors[180];
int BRIGHTNESS = 50; // 0-100
void setup() {
for (int i=0; i<180; i++) {
int hue = i * 2;
int saturation = 100;
int lightness = BRIGHTNESS;
// pre-compute the 180 rainbow colors
rainbowColors[i] = makeColor(hue, saturation, lightness);
}
leds.begin();
leds.show();
}
void loop() {
rainbow(10, 2500);
}
void rainbow(int phaseShift, int cycleTime)
{
int color, x, wait;
wait = cycleTime * 1000 / ledsPerStrip;
for (color=0; color < 180; color++) {
for (x=0; x < leds.numPixels(); x++) {
int index = (color + x) % 180;
leds.setPixel(x, rainbowColors[index]);
}
leds.show();
delayMicroseconds(wait);
}
}
int makeColor(unsigned int hue, unsigned int saturation, unsigned int lightness)
{
unsigned int red, green, blue;
unsigned int var1, var2;
if (hue > 359) hue = hue % 360;
if (saturation > 100) saturation = 100;
if (lightness > 100) lightness = 100;
// algorithm from: http://www.easyrgb.com/index.php?X=MATH&H=19#text19
if (saturation == 0) {
red = green = blue = lightness * 255 / 100;
} else {
if (lightness < 50) {
var2 = lightness * (100 + saturation);
} else {
var2 = ((lightness + saturation) * 100) - (saturation * lightness);
}
var1 = lightness * 200 - var2;
red = h2rgb(var1, var2, (hue < 240) ? hue + 120 : hue - 240) * 255 / 600000;
green = h2rgb(var1, var2, hue) * 255 / 600000;
blue = h2rgb(var1, var2, (hue >= 120) ? hue - 120 : hue + 240) * 255 / 600000;
}
return (red << 16) | (green << 8) | blue;
}
unsigned int h2rgb(unsigned int v1, unsigned int v2, unsigned int hue)
{
if (hue < 60) return v1 * 60 + (v2 - v1) * hue;
if (hue < 180) return v2 * 60;
if (hue < 240) return v1 * 60 + (v2 - v1) * (240 - hue);
return v1 * 60;
}