From 5a59a8f50bdfad899ca415ad224733fc974cffd2 Mon Sep 17 00:00:00 2001 From: Greg Smith Date: Sun, 5 Jun 2022 19:11:34 -0400 Subject: [PATCH] add __slots__ to Neopixel class (as comment!) --- neopixel.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/neopixel.py b/neopixel.py index 71436b5..fe50e4f 100644 --- a/neopixel.py +++ b/neopixel.py @@ -47,6 +47,19 @@ def sk6812(): # Same hold for every other index (and - 1 at the end for 3 letter strings). class Neopixel: + # Micropython doesn't implement __slots__, but it's good to have a place + # to describe the data members... + #__slots__ = [ + # 'num_leds', # number of LEDs + # 'pixels', # array.array('I') of raw data for LEDs + # 'mode', # mode 'RGB' etc + # 'W_in_mode', # bool: is 'W' in mode + # 'sm', # state machine + # 'shift', # shift amount for each component : { 'R': shift_R, ... } + # 'delay', # delay amount + # 'brightnessvalue', # brightness scale factor 1..255 + #] + def __init__(self, num_leds, state_machine, pin, mode="RGB", delay=0.0001): self.pixels = array.array("I", [0 for _ in range(num_leds)]) self.mode = mode