Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Deprecated updateType(), updateLength() and setPin()
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Deprecated updateType(), updateLength() and setPin()

by Shredy777 on Sat Oct 16, 2021 7:03 pm

Hello there,

I'm trying to understand the explanation on the deprecated functions updateType(), updateLength() and setPin(). It says in the documentation that we now need to use the 'new' keyword with the first constructor syntax (length, pin, type). It is a bit hard for me to understand how to exactly use this, as I cannot find an example anywhere. Is there anybody who can explain this in a bit more detail?

Many thanks in advance :)

Shredy777
 
Posts: 2
Joined: Sat Oct 16, 2021 6:59 pm

Re: Deprecated updateType(), updateLength() and setPin()

by mikeysklar on Mon Oct 18, 2021 7:31 pm

Can you link to the documentation?

mikeysklar
 
Posts: 6222
Joined: Mon Aug 01, 2016 8:10 pm

Re: Deprecated updateType(), updateLength() and setPin()

by Shredy777 on Mon Oct 18, 2021 7:35 pm

Yeah of course!

https://adafruit.github.io/Adafruit_NeoPixel/html/class_adafruit___neo_pixel.html

Its this part:

Adafruit_NeoPixel::Adafruit_NeoPixel ( void )
"Empty" NeoPixel constructor when length, pin and/or pixel type are not known at compile-time, and must be initialized later with updateType(), updateLength() and setPin().

Returns
Adafruit_NeoPixel object. Call the begin() function before use.
Note
This function is deprecated, here only for old projects that may still be calling it. New projects should instead use the 'new' keyword with the first constructor syntax (length, pin, type).

Shredy777
 
Posts: 2
Joined: Sat Oct 16, 2021 6:59 pm

Please be positive and constructive with your questions and comments.