nickovs/ws2812-SPI

_n rather than n used for number pixels available in string

Closed this issue · 2 comments

Hi

No big deal, in MicroPython 1.13 the standard library uses 'n' for the number of pixels, for example:
for pixel in range(np.n)

Your code uses '_n' which is a slight variation:

for pixel in range(np._n)

otherwise very smooth operation for me. Cheers Andy

I made the variable private to indicate that it shouldn't be changed after the fact but I can see that it's useful to be able to access the count, so I've added a property called n to allow read-only access to the count.

Included, tested, working, slap like, subscribe and ring the bell!