Teensy 3.1 & Programmable WS2812B RGB LED POV Staff - Newbie Questions

Status
Not open for further replies.
Yeah, until then, this:

Mess 20151116_071441.jpg
 
Hello!
Just encountered unknown problem with TLC5947&teensyLC/3.1
using adafruit TLC5947 library, the device works and displays as programmed for few cycles(seconds)
and then runs random or like whatever it like, even idle for seconds and continues

I'm guessing the library shiftouts so fast(with 48mHz/72mHz , about 1-3us per bit) and drives the driver crazy

still figuring if battery problem,connection, poor jump wires or anything
did anyone bumped into similar problem?
 
I'm also keen to find out.

The next version of the Mitochondrion glow staff is now spinnable and ready for Kiwiburn. The on-Teensy memory only holds about fifty images and those are only 16 colour, so I'd be delighted to have more memory to work with. And my audio FFT visualiser is far from what it could be.

No spinning pics yet, coz I don't have a camera that can cope, but here's some of the construction.

20160106_072209.jpg
20160106_072242.jpg
20160106_072326.jpg
 
@happyinmotion
I'm planing using SPIflash for that, a winbond SPIFLASH chip could hold up to 16Mbit or more,
and wow, looks like you have four-sided apa102 ,from the constuctions, I will be waiting for your pics.
 
@happyinmotion
I'm planing using SPIflash for that, a winbond SPIFLASH chip could hold up to 16Mbit or more,
and wow, looks like you have four-sided apa102 ,from the constuctions, I will be waiting for your pics.

Yup, four sided, 200 LEDs per strip, so 800 LEDs in total. You can use this in daylight.

There's enough room inside a 25.4 mm ID tube for a 14500 cell, the cell holder, four PCBs, four LED strips, and pretty much nothing else.

Cells go at the ends, then there's room at the middle in the centre for another board that holds the Teensy and other gubbins. There's also enough room, just, for JST XH connectors to distribute power and data from the boards with the cells to the three other boards.
 
that's a bigger tube than I usually use (22mm internal diameter)
do you use AA batteries? or many 14500 lithium batteries? i spot a Trustfire battery above, I can't imagine 800 LEDs' power drain,

also,I see a lot of soldering , the clock/data/volt and ground, are they just simple PC plate(or stick) board that carries the LED strips?

I'm currently designing a PCB board for makers to start with an easy POV.
what do you think about laying out the lines on the board(with pads designed for APA102)
for less soldering, or more laziness, LOL
 
I'm currently designing a PCB board for makers to start with an easy POV.
what do you think about laying out the lines on the board(with pads designed for APA102)
for less soldering, or more laziness, LOL
I would suggest that it might be ok for testing, but for using it in something like a spinning staff, you want to do regular solder (and probably through hole solder with 2 rows that you can securely attach the wires, and know they won't come out when spinning it.
 
Batteries are 14500 lithiums. Power is capped at 10 Watts by FastLED, which is bright enough for daytime use. More power drain just sags the battery Voltage and causes red-out.

Boards on three of the four sides just distribute power and data. I've tied strips to the power and ground in multiple places for redundancy.

My preference for reliable connections to strips is to sew with thin wire through the holes in the strip pads before soldering. That gives a solid joint. Sewing also works for joining strips and I've a guide to how I do it here. For the middle of the strips, it can be hard to locate exactly where the strip pads will be, so I just put a row of vias in and sew to the closest.

20160122_074301 - cropped.jpg

20160122_074529 - cropped.jpg

20160122_074754 - cropped.jpg
 
I would suggest that it might be ok for testing, but for using it in something like a spinning staff, you want to do regular solder (and probably through hole solder with 2 rows that you can securely attach the wires, and know they won't come out when spinning it.
sorry i didn't make my idea fully clear, the pads were for soldering, not just sticking on.
and yes, they have some holes through the pad, so that the pad wouldn't torn easily during spinning or soldering


never thought of sewing before soldering, thanks for the idea and the link,
those strips with tiny circle pads are just uneasy to solder, with oxidated surfaces, even harder.

my ways are pads right under the four circles,
strips with adhesive can stick well ,( and must remember to remove the adhesive under the junction points)
the distance of the circles varies between different source of strips, i did the same way to locate, larger pads
 
In about 6 weeks, PJRC will start selling a shield meant for these types of projects. The PCBs went into manufacturing this week, so this product has finally moved from the lengthy planning & design phase to the beginning of production. Normally I resist the vaporware urge to mention stuff in development which has no clear delivery date. Since this is now in production, you can be pretty sure we'll be selling these before Chistmas....

is there any progress? i will be very happy to see these boards.
thx for short reply
 
I've put together a pretty detailed write up of the Mitochondrion, Mark 5.3, with lots of high-quality pics and technical details included.

_T8A5303.jpg

_T8A5279.jpg

This has survived it's first festival (Kiwiburn) with no damage. Next job is adding a watch-dog timer, so that it resets properly when the batteries bounce when I drop it.
 
WOW, that's lots of effort
Can't wait to share mine

Mines would be featuring time setting for each picture ,for music performance
And a GUI for any user

But I certainly don't have many leds and area in space :(
Had only 18/36 for poi /staff . Limited to SD speed this version

Speaking of switch. Have you tried any with RF remote control ?
 
Thanks.

Mines would be featuring time setting for each picture ,for music performance
And a GUI for any user
Speaking of switch. Have you tried any with RF remote control ?

Yes, that's on the list of things I'd like to do next. I'm thinking something like a BlueSmiRF to wirelessly link to a phone running MIT App Inventor or equivalent.
 
Hello everyone,

first of all thanks for your code "Mortonkopf" I am working with your code to make spinning Pov-Display with Lpd8806 LED Strips with 2 Wings.

but because i used two lpd8806 LED Strips i have speed problem.

If first strip shows 1 slice of image then second strip has to show 88 slice of image to get whole image when the propeller spins.

I put almos same code twice to seperate image. So the Teensy Cpu has to complie longer so the frequency becomes slower.

How can i make frequency more faster? (leds should blink faster / now i have 264ms but purpose is 200ms)

Is there anyone who can help me?



i use total 56 leds.

image size ist 56 * 176

int rightWing[29] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26 , 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56};
int leftWing[29] = {0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55};

int lastVersion[176] = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120 ,121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 ,57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87};

for (int row=0; row<bmpHeight; row++) {
{ if(flip)
pos1 = bmpImageoffset + (bmpHeight - 1 - lastVersion[row]) * rowSize;
else
pos1 = bmpImageoffset + lastVersion[row] * rowSize;
if(bmpFile.curPosition() != pos1) {
bmpFile.seekSet(pos1);
buffidx = sizeof(sdbuffer);
}
for (int col=0; col<bmpWidth; col++) {
// read more pixel data
if (buffidx >= sizeof(sdbuffer)) {
povidx = 0;
bmpFile.read(sdbuffer, sizeof(sdbuffer));
buffidx = 0;
}
// set pixel
r = sdbuffer[buffidx++];
g = sdbuffer[buffidx++];
b = sdbuffer[buffidx++];

povbuffer[povidx++] =(((uint32_t)b & 0x80 )<<16 | ((uint32_t)g & 0x80)<<8 | (uint32_t)r & 0x80);

}
for(int i=0;i<28;i++){
leds1 = povbuffer[leftWing];
}

}
{
if(flip) // Bitmap is stored bottom-to-top order (normal BMP)
pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
else // Bitmap is stored top-to-bottom
pos = bmpImageoffset + row * rowSize;
if(bmpFile.curPosition() != pos) { // Need seek?
bmpFile.seekSet(pos);
buffidx = sizeof(sdbuffer); // Force buffer reload
}
for (int col=0; col<bmpWidth; col++) { // For each column...
// read more pixel data
if (buffidx >= sizeof(sdbuffer)) {
povidx = 0;
bmpFile.read(sdbuffer, sizeof(sdbuffer));
buffidx = 0; // Set index to beginning
}
// set pixel
r = sdbuffer[buffidx++];
g = sdbuffer[buffidx++];
b = sdbuffer[buffidx++];
//we need to output BRG 24bit colour//

povbuffer[povidx++] =(((uint32_t)b & 0x80 )<<16 | ((uint32_t)g & 0x80)<<8 | (uint32_t)r & 0x80);
//Color(b,r,g);//octo colour, but you might need to change this
}
for(int i=0;i<28;i++){
leds = povbuffer[rightWing];

}
}
FastLED.show();
 
@corumlee, how about reading from the sd file once, but for both strips, read first set of led values and second set from same buffer, just offset the second led read position by the length of the first strip. This way you only read fro the SD once instead of twice? That would read into povbuffer for both leftwing and rightwing from accessing the sd once?
 
@corumlee, how about reading from the sd file once, but for both strips, read first set of led values and second set from same buffer, just offset the second led read position by the length of the first strip. This way you only read fro the SD once instead of twice? That would read into povbuffer for both leftwing and rightwing from accessing the sd once?

Hello, mortonkopf. thank you for your quickly reply. actually i thought also similar idea and made it with your another code.

int rightWing[29] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26 , 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56}; // {56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2};
int leftWing[29] = {0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55}; // {55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1};
int lastVersion[150] = {75, 76, 77 ~~150, 1, 2, 3 ~~74}
for (int x = 0; x < f; x++) {
for (z = 28; z > 0; z--) {
leds[z - 1] = array[x + ((j - rightWing[z]) * f)];
leds1[z - 1] = array[lastVersion[x] + ((j - leftWing[z]) * f)];
// Serial.println(lastVersion[x]);
// Serial.println(x);

}

but this time with SD card buffer it seems quite different.

can you please show me the rough where i should write and how i should construct the additional code?

if(flip) // Bitmap is stored bottom-to-top order (normal BMP)
pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
else // Bitmap is stored top-to-bottom
pos = bmpImageoffset + row * rowSize;
if(bmpFile.curPosition() != pos) { // Need seek?
bmpFile.seekSet(pos);
buffidx = sizeof(sdbuffer); // Force buffer reload
}
for (int col=0; col<bmpWidth; col++) { // For each column...
// read more pixel data
if (buffidx >= sizeof(sdbuffer)) {
povidx = 0;
bmpFile.read(sdbuffer, sizeof(sdbuffer));
buffidx = 0; // Set index to beginning
}
// set pixel
r = sdbuffer[buffidx++];
g = sdbuffer[buffidx++];
b = sdbuffer[buffidx++];
//we need to output BRG 24bit colour//

povbuffer[povidx++] =(((uint32_t)g)<<16 | ((uint32_t)b)<<8 | (uint32_t)r);
//Color(b,r,g);//octo colour, but you might need to change this

}
for(int i=0;i<28;i++){
// Serial.println(povbuffer[rightWing]);
leds = povbuffer[rightWing];

//i think i should write some addtional code here.

}
}
 
if you increase the sdbuffer to your total number of leds, 56, then you can fill the buffer for both sides in one call. Your numbering of the array led values is odd to me. Are you using two strips of leds next to each other? the physical setup is important for knowing how to do the for loops


You also have the zero led in both arrays, which is probably not what you want.
 
I guess with proper stacking purpose , modifying your picture(bmps) in your PC
reading lines at one could be easy, but its connected to how you read and show your strips,
you MUST know what effect you want


and and speaking of speed,
//we need to output BRG 24bit colour//

actually if you don't need full depth bmp
change the BMP format to 8 bit (256color) while saving,
and you need to add a reference array to read the the color indexs,
(should need a extra 256*3 bytes RAM, not much for teensy)

I reference them with a fixed table of 3-3-2? format, and saves my file all with the same color table
which stores RGB color with 3bits for Red,Green and 2bits for blue (eyes are insensitive to blue's gamma,relative to red&green)

byte rawcolor = buff[x];
b = mapop(((rawcolor / 4) % 8));
g = (rawcolor % 4) * 85 ;
r = mapop((rawcolor / 32));
}
}

inline byte mapop(byte ok)
{
const byte T256C[8] = {0, 36, 73, 109, 146, 182, 219, 255};
return T256C[ok];
}

it should also be faster if you use jpeg, gif, png since they are significant smaller
but i didn't figure how they encode, worth a try

last but not least, did you use teensy 3.2 or 3.5/6? SDIO should be fast enough to read the pictures,
are you sure your program is stucking at reading file? or showing the strips?
I took a look in the datasheet, its a SPI chip with 20Mhz rates,
but speeds may shown low if SPI settings were slow , or if you uses softSPI?(pins thats not hardware SPIs)

Can you show what your hardware is like, or the POV effect is like? its hard to imagine just from your code
and also your setup() ? as needed to find SPI settings/data out pin
 
Status
Not open for further replies.
Back
Top