Skip to content

Conversation

@kgleeson
Copy link

This fixes issues with glitching pixels I had on a Neopixel 60 ring with 5v/10a psu.

@kgleeson
Copy link
Author

Thats updated now and should be good to go.

It has my Neopixel 60 ring running perfectly glitch free now https://www.youtube.com/watch?v=AR_XrYeBeIU :)

@ersatzavian
Copy link
Contributor

That is fantastic. Thank you so much.

@mezelve
Copy link

mezelve commented Mar 31, 2014

the new code throws an error:
[Status] Device booting; 5.88% program storage used
[Device] ERROR: the index 'BYTESPERPIXEL' does not exist
[Device] ERROR: at main:16

so I moved BYTESPERPIXEL outside the neopixel class
and defined it as a const
const BYTESPERPIXEL = 24;

code doesn't throw an error now
but I still get glitches after the 26th pixel on my 60 pixel WS2812B ring.

@kgleeson would you mind sharing the code from the video?

@kgleeson
Copy link
Author

Ah ha, turns out when I changed the clearblob I hadn’t actually ran it, but I had when I changed the other lines.

Sure I’ve the code up at https://gist.github.com/kgleeson/9387458

On Monday 31 March 2014 at 20:03, Pieter wrote:

the new code throws an error:
[Status] Device booting; 5.88% program storage used
[Device] ERROR: the index 'BYTESPERPIXEL' does not exist
[Device] ERROR: at main:16
so I moved BYTESPERPIXEL outside the neopixel class
and defined it as a const
const BYTESPERPIXEL = 24;
code doesn't throw an error now
but I still get glitches after the 26th pixel on my 60 pixel WS2812B ring.
@kgleeson (https://github.com/kgleeson) would you mind sharing the code from the video?


Reply to this email directly or view it on GitHub (#11 (comment)).

@blindman2k
Copy link
Contributor

Realistically, it won't make a difference in this case but its risky
practice to initialise instance blobs in the class definition as if you
instantiate two objects of the same class they will share the memory
(somewhat like a static property). You are better off leaving the const
definition inside the constructor (optional) and allocating the blob inside
the constructor too. Leaving out the rest of the stuff, this is what it
would/could look like.

class NeoPixels
{
clearblob = null;

constructor(_spi, _frameSize)
{

    const BYTESPERPIXEL   = 24;
    clearblob = blob(BYTESPERPIXEL);

}
}

On Mon, Mar 31, 2014 at 12:23 PM, Kieran Gleeson
notifications@github.comwrote:

Ah ha, turns out when I changed the clearblob I hadn't actually ran it,
but I had when I changed the other lines.

Sure I've the code up at https://gist.github.com/kgleeson/9387458

Thanks,
Kieran Gleeson

On Monday 31 March 2014 at 20:03, Pieter wrote:

the new code throws an error:
[Status] Device booting; 5.88% program storage used
[Device] ERROR: the index 'BYTESPERPIXEL' does not exist
[Device] ERROR: at main:16
so I moved BYTESPERPIXEL outside the neopixel class
and defined it as a const
const BYTESPERPIXEL = 24;
code doesn't throw an error now
but I still get glitches after the 26th pixel on my 60 pixel WS2812B
ring.
@kgleeson (https://github.com/kgleeson) would you mind sharing the code
from the video?

Reply to this email directly or view it on GitHub (
#11 (comment)).

Reply to this email directly or view it on GitHubhttps://github.com//pull/11#issuecomment-39129942
.

@blindman2k
Copy link
Contributor

Hi all,

I just finally got my NeoPixel ring to stop glitching by dropping the SPI
clock rate to 3750 kHz.

const SPICLK = 3750; // kHz

A.

On Mon, Mar 31, 2014 at 1:40 PM, Aron Steg aron.steg@bcde.com.au wrote:

Realistically, it won't make a difference in this case but its risky
practice to initialise instance blobs in the class definition as if you
instantiate two objects of the same class they will share the memory
(somewhat like a static property). You are better off leaving the const
definition inside the constructor (optional) and allocating the blob inside
the constructor too. Leaving out the rest of the stuff, this is what it
would/could look like.

class NeoPixels
{
clearblob = null;

constructor(_spi, _frameSize)

{

    const BYTESPERPIXEL   = 24;

    clearblob = blob(BYTESPERPIXEL);

}
}

On Mon, Mar 31, 2014 at 12:23 PM, Kieran Gleeson <notifications@github.com

wrote:

Ah ha, turns out when I changed the clearblob I hadn't actually ran it,
but I had when I changed the other lines.

Sure I've the code up at https://gist.github.com/kgleeson/9387458

Thanks,
Kieran Gleeson

On Monday 31 March 2014 at 20:03, Pieter wrote:

the new code throws an error:
[Status] Device booting; 5.88% program storage used
[Device] ERROR: the index 'BYTESPERPIXEL' does not exist
[Device] ERROR: at main:16
so I moved BYTESPERPIXEL outside the neopixel class
and defined it as a const
const BYTESPERPIXEL = 24;
code doesn't throw an error now
but I still get glitches after the 26th pixel on my 60 pixel WS2812B
ring.
@kgleeson (https://github.com/kgleeson) would you mind sharing the
code from the video?

Reply to this email directly or view it on GitHub (
#11 (comment)).

Reply to this email directly or view it on GitHubhttps://github.com//pull/11#issuecomment-39129942
.

@mezelve
Copy link

mezelve commented Mar 31, 2014

That's it! Thank you @blindman2k !
I've added your 2 modifications. https://gist.github.com/mezelve/9903312

@mezelve
Copy link

mezelve commented Mar 31, 2014

Ok. I still have some issues with clearFrame().
For now I'm looping through all the pixels and I set them to [0,0,0].

@kgleeson
Copy link
Author

kgleeson commented Apr 1, 2014

This causes my 60 ring to just go white, reverting back to 7500 works perfectly.

I hadn't tried it recently, but even with the spi clock at 7500, the code makes my 60 led/m strip just display random colours for pixels 0 - 34 and nothing after that.

@blindman2k
Copy link
Contributor

I tested on my other NeoPixels at home and it won't stay stable, even at 3750khz. Any movement of the USB cable (particularly at the connector in the power source) and the colours go haywire. It is better at 3750khz but its still not usable. Back to the hardware drawing board for me.

@blindman2k
Copy link
Contributor

Yay! I am back up and running. I added a diode, as per @tombrew's instructions, to drop the voltage a bit and at 3750khz everything is perfectly stable and I am busy creating animations.

@cat-haines
Copy link
Contributor

Close PR - significantly out of date

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

Successfully merging this pull request may close these issues.

5 participants