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 :)
Deprecated updateType(), updateLength() and setPin()
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Shredy777
- Posts: 2
- Joined: Sat Oct 16, 2021 6:59 pm
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Deprecated updateType(), updateLength() and setPin()
Can you link to the documentation?
- Shredy777
- Posts: 2
- Joined: Sat Oct 16, 2021 6:59 pm
Re: Deprecated updateType(), updateLength() and setPin()
Yeah of course!
https://adafruit.github.io/Adafruit_Neo ... pixel.html
Its this part:
https://adafruit.github.io/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).
Please be positive and constructive with your questions and comments.