class documentation
class NeoLed:
Known subclasses: rp2da2.lib.led_pio.BlkLed, rp2da2.lib.led_pio.ComsLed
Constructor: NeoLed(string_index)
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 |
Set the LED unlit. |
| Constant | COMMS |
Led for communications status |
| Constant | DCC |
Led for DCC status |
| Constant | DEFAULT |
Default Brightness |
| Constant | LED |
Blue |
| Constant | LED |
Green |
| Constant | LED |
Red |
| Instance Variable | _i |
Undocumented |
| Instance Variable | _rgb |
Undocumented |
| Instance Variable | _string |
Undocumented |
overridden in
rp2da2.lib.led_pio.BlkLed, rp2da2.lib.led_pio.ComsLedInitialise the NeoPixel class
This sets the initial RGB.
| Parameters | |
| string | The index of the LED in the string. |
Clear a colour from the LED.
This clears the colour of the LED
| Parameters | |
| colour | The colour to clear. This should be one of NeoLed.LED_R, NeoLed.LED_G or NeoLed.LED_B. |
| flush | If true the led string is written following the update |
Set the colour of the LED
This sets a colour (red, green or blue) and brightness value.
| Parameters | |
| colour | The colour to set. This should be one of NeoLed.LED_R, NeoLed.LED_G or NeoLed.LED_B. |
| flush | If true the led string is written following the update |
| val | The value to set the colour to. This should be an integer between 0 and 255. If not specified, it defaults to NeoLed.DEFAULT_B. |