class documentation

NeoPixel Led

This class controls a single LED on the chain.

RGB values may either be passed as a tuple or a single colour may be set or cleared.

Setting a colour without a value will set the defaul. Clearing a colour will set 0.

Method __init__ Initialise the NeoPixel class
Method clear Clear a colour from the LED.
Method set Set the colour of the LED
Method set_off Set the LED unlit.
Constant COMMS_LED Led for communications status
Constant DCC_LED Led for DCC status
Constant DEFAULT_B Default Brightness
Constant LED_B Blue
Constant LED_G Green
Constant LED_R Red
Instance Variable _i Undocumented
Instance Variable _rgb Undocumented
Instance Variable _string Undocumented
def __init__(self, string_index):

Initialise the NeoPixel class

This sets the initial RGB.

Parameters
string_indexThe index of the LED in the string.
def clear(self, colour, flush=True):

Clear a colour from the LED.

This clears the colour of the LED

Parameters
colourThe colour to clear. This should be one of NeoLed.LED_R, NeoLed.LED_G or NeoLed.LED_B.
flushIf true the led string is written following the update
def set(self, colour, flush=True, *, val=DEFAULT_B):

Set the colour of the LED

This sets a colour (red, green or blue) and brightness value.

Parameters
colourThe colour to set. This should be one of NeoLed.LED_R, NeoLed.LED_G or NeoLed.LED_B.
flushIf true the led string is written following the update
valThe value to set the colour to. This should be an integer between 0 and 255. If not specified, it defaults to NeoLed.DEFAULT_B.
def set_off(self, flush=True):

Set the LED unlit.

This clears all colours from the LED leaving it unlit.

Parameters
flushIf true the led string is written following the update
COMMS_LED =

Led for communications status

Value
const(0)
DCC_LED =

Led for DCC status

Value
const(1)
DEFAULT_B =

Default Brightness

Value
const(50)
LED_B =

Blue

Value
const(2)
LED_G =

Green

Value
const(1)
LED_R =

Red

Value
const(0)
_i =

Undocumented

_rgb: list[int] =

Undocumented

_string =

Undocumented