QwiicLEDStick.
More...
|
def | __init__ (self, address=None, i2c_driver=None) |
|
def | is_connected (self) |
| Determine if a Qwiic SGP40 device is connected to the system. More...
|
|
def | begin (self) |
| Initialize the operation of the Qwiic LED Stick. More...
|
|
def | set_single_LED_color (self, number, red, green, blue) |
| Change the color of a specific LED. More...
|
|
def | set_all_LED_color (self, red, green, blue) |
| Set the color of all LEDs in the string. More...
|
|
def | set_all_LED_unique_color (self, red_list, green_list, blue_list, length) |
| Change the color of all LEDs at once to individual values. More...
|
|
def | set_single_LED_brightness (self, number, brightness) |
| Change the brightness of a specific LED while keeping their current color. More...
|
|
def | set_all_LED_brightness (self, brightness) |
| Change the brightness of all LEDs while keeping their current color. More...
|
|
def | LED_off (self) |
| Turn all LEDs off by setting color to 0. More...
|
|
def | change_address (self, new_address) |
| Change the I2C address from one address to another. More...
|
|
def | change_length (self, new_length) |
| Change the length of the LED string. More...
|
|
QwiicLEDStick.
- Parameters
-
address | The I2C address to use for the device. If not provided, the default address is used. |
i2c_driver | An existing i2c driver object. If not provided a a driver is created. |
- Returns
- Object The GPIO device object.
◆ __init__()
def qwiic_led_stick.QwiicLEDStick.__init__ |
( |
|
self, |
|
|
|
address = None , |
|
|
|
i2c_driver = None |
|
) |
| |
◆ begin()
def qwiic_led_stick.QwiicLEDStick.begin |
( |
|
self | ) |
|
Initialize the operation of the Qwiic LED Stick.
Run is_connected()
- Returns
- bool Returns true if an LED Stick is connected to the system False otherwise.
◆ change_address()
def qwiic_led_stick.QwiicLEDStick.change_address |
( |
|
self, |
|
|
|
new_address |
|
) |
| |
Change the I2C address from one address to another.
- Parameters
-
new_address | the new address to be set to. Must be valid. |
- Returns
- Void Nothing
◆ change_length()
def qwiic_led_stick.QwiicLEDStick.change_length |
( |
|
self, |
|
|
|
new_length |
|
) |
| |
Change the length of the LED string.
- Parameters
-
new_length | the new length of the LED string |
- Returns
- bool true if the command was sent successfully, false otherwise.
◆ is_connected()
def qwiic_led_stick.QwiicLEDStick.is_connected |
( |
|
self | ) |
|
Determine if a Qwiic SGP40 device is connected to the system.
- Returns
- bool True if the device is connected, false otherwise.
◆ LED_off()
def qwiic_led_stick.QwiicLEDStick.LED_off |
( |
|
self | ) |
|
Turn all LEDs off by setting color to 0.
- Returns
- bool true if the command was sent successfully, false otherwise.
◆ set_all_LED_brightness()
def qwiic_led_stick.QwiicLEDStick.set_all_LED_brightness |
( |
|
self, |
|
|
|
brightness |
|
) |
| |
Change the brightness of all LEDs while keeping their current color.
To turn all LEDs off but remember their previous color, set brightness to 0
- Parameters
-
brightness | value of LED brightness between 0 and 31. |
- Returns
- bool true if the command was sent successfully, false otherwise.
◆ set_all_LED_color()
def qwiic_led_stick.QwiicLEDStick.set_all_LED_color |
( |
|
self, |
|
|
|
red, |
|
|
|
green, |
|
|
|
blue |
|
) |
| |
Set the color of all LEDs in the string.
Each will be shining the same color. The color value must be between 0-255.
- Parameters
-
red | the red value to set all LEDs to. Between 0 and 255. |
green | the green value to set all LEDs to. Between 0 and 255. |
blue | the blue value to set all the LEDs to. Between 0 and 255. |
- Returns
- bool Returns true if command is written successfully, false otherwise
◆ set_all_LED_unique_color()
def qwiic_led_stick.QwiicLEDStick.set_all_LED_unique_color |
( |
|
self, |
|
|
|
red_list, |
|
|
|
green_list, |
|
|
|
blue_list, |
|
|
|
length |
|
) |
| |
Change the color of all LEDs at once to individual values.
- Parameters
-
red_list | a list of red values for the LEDs. Index 0 of red_list corresponds to the red value of LED 0. |
blue_list | a list of blue values for the LEDs. |
green_list | a list of green values for the LEDs. |
length | the length of the LED string. |
- Returns
- bool True if commands are written successfully, false otherwise
◆ set_single_LED_brightness()
def qwiic_led_stick.QwiicLEDStick.set_single_LED_brightness |
( |
|
self, |
|
|
|
number, |
|
|
|
brightness |
|
) |
| |
Change the brightness of a specific LED while keeping their current color.
To turn LEDs off but remember their previous color, set brightness to 0.
- Parameters
-
number | number of LED to change brightness. LEDs indexed starting at 1. |
brightness | value of LED brightness between 0 and 31. |
- Returns
- bool true if the command was sent successfully, false otherwise.
◆ set_single_LED_color()
def qwiic_led_stick.QwiicLEDStick.set_single_LED_color |
( |
|
self, |
|
|
|
number, |
|
|
|
red, |
|
|
|
green, |
|
|
|
blue |
|
) |
| |
Change the color of a specific LED.
- Parameters
-
number | the number of LED. Indexing starts at 1. |
red | the red value between 0 and 255 |
green | the green value between 0 and 255 |
blue | the blue value between 0 and 255 |
- Returns
- bool Returns true if command written successfully, false otherwise
◆ address
qwiic_led_stick.QwiicLEDStick.address |
◆ available_addresses
qwiic_led_stick.QwiicLEDStick.available_addresses = _AVAILABLE_I2C_ADDRESS |
|
static |
◆ COMMAND_CHANGE_ADDRESS
int qwiic_led_stick.QwiicLEDStick.COMMAND_CHANGE_ADDRESS = 0xC7 |
|
static |
◆ COMMAND_CHANGE_LED_LENGTH
int qwiic_led_stick.QwiicLEDStick.COMMAND_CHANGE_LED_LENGTH = 0x70 |
|
static |
◆ COMMAND_WRITE_ALL_LED_BRIGHTNESS
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_ALL_LED_BRIGHTNESS = 0x77 |
|
static |
◆ COMMAND_WRITE_ALL_LED_COLOR
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_ALL_LED_COLOR = 0x72 |
|
static |
◆ COMMAND_WRITE_ALL_LED_OFF
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_ALL_LED_OFF = 0x78 |
|
static |
◆ COMMAND_WRITE_BLUE_ARRAY
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_BLUE_ARRAY = 0x75 |
|
static |
◆ COMMAND_WRITE_GREEN_ARRAY
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_GREEN_ARRAY = 0x74 |
|
static |
◆ COMMAND_WRITE_RED_ARRAY
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_RED_ARRAY = 0x73 |
|
static |
◆ COMMAND_WRITE_SINGLE_LED_BRIGHTNESS
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_SINGLE_LED_BRIGHTNESS = 0x76 |
|
static |
◆ COMMAND_WRITE_SINGLE_LED_COLOR
int qwiic_led_stick.QwiicLEDStick.COMMAND_WRITE_SINGLE_LED_COLOR = 0x71 |
|
static |
◆ device_name
qwiic_led_stick.QwiicLEDStick.device_name = _DEFAULT_NAME |
|
static |
The documentation for this class was generated from the following file: