Closed
Description
ref: pull request #59
Before we could update pixels.buf
(Neopixel obj) directly, but it does not work with new _pixelbuf
based Neopixel
.
Now it returns an error:
>>> type(pixels.buf)
<class 'bytearray'>
>>> pixels.buf = b'\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00\x01\x04\x00'
AttributeError: 'NeoPixel' object has no attribute 'buf'
Simple example for circuitplayground that works with current releases using old Neopixel
object not using _pixelbuf
:
from random import randint
import board
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)
pixels.buf = bytearray(randint(0,255) for i in range(30)) # <=- now fails
pixels.show()
Thank you.
Metadata
Metadata
Assignees
Labels
No labels