As far as I know (correct me if I'm wrong) Arduinos support for NeoPixels is not part of the Arduino language itself. It's an add-in library that you have to download, install and include into your code in order to use it. It's not written or maintained by "Arduino the company" but by some third party (user, company, community) and I'm pretty sure there's more than ONE version of that library to choose from as well. Which can be confusing.
The same thing goes for a lot of other stuff that "Arduino has" - it's libraries written by users and rest assured that the quality of them varies. Pretty much the same thing as "our" stuff.
The big advantage is the encapsulation that proper function calls with parameter passing, local variables and return values provides. This provides the means to "hide away" even more stuff from the user than with PBP that doesn't support function calls and/or local variables. It's not magic though.
A month or so ago I posted code for driving SK6812 RGBW LEDs. Using that particular code your example
Code:
NEOPIXEL $ADDR,$BRIGHTNESS,$R,$G,$B
Would look like:
Code:
Red[ADDR]=R : Green[ADDR]=G : Blue[ADDR]=B : GOSUB UpdateDisplay
And if you wanted you could rename the UpdateDisplay subroutine to NEOPIXEL and it would be
Code:
Red[ADDR]=R : Green[ADDR]=G : Blue[ADDR]=B : GOSUB NEOPIXEL
Not THAT much different now, is it? Granted, the "library" IS hardcoded to run at 64MHz so you won't run a 16x16pixel array on a 12F508 - for multiple reasons.
You still need to include the code and set up some variables and aliases, but you don't get away from that with Arduino either.
Bookmarks