Qwiic_LED_Stick_Py  2.0.0
Python for SFE Qwiic LED Stick
All Classes Namespaces Files Functions Variables Pages
qwiic_led_stick.QwiicLEDStick Class Reference

QwiicLEDStick. More...

Inheritance diagram for qwiic_led_stick.QwiicLEDStick:

Public Member Functions

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...
 

Public Attributes

 address
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 
int COMMAND_CHANGE_ADDRESS = 0xC7
 
int COMMAND_CHANGE_LED_LENGTH = 0x70
 
int COMMAND_WRITE_SINGLE_LED_COLOR = 0x71
 
int COMMAND_WRITE_ALL_LED_COLOR = 0x72
 
int COMMAND_WRITE_RED_ARRAY = 0x73
 
int COMMAND_WRITE_GREEN_ARRAY = 0x74
 
int COMMAND_WRITE_BLUE_ARRAY = 0x75
 
int COMMAND_WRITE_SINGLE_LED_BRIGHTNESS = 0x76
 
int COMMAND_WRITE_ALL_LED_BRIGHTNESS = 0x77
 
int COMMAND_WRITE_ALL_LED_OFF = 0x78
 

Detailed Description

QwiicLEDStick.

Parameters
addressThe I2C address to use for the device. If not provided, the default address is used.
i2c_driverAn existing i2c driver object. If not provided a a driver is created.
Returns
Object The GPIO device object.

Constructor & Destructor Documentation

◆ __init__()

def qwiic_led_stick.QwiicLEDStick.__init__ (   self,
  address = None,
  i2c_driver = None 
)

Member Function Documentation

◆ 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_addressthe 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_lengththe 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
brightnessvalue 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
redthe red value to set all LEDs to. Between 0 and 255.
greenthe green value to set all LEDs to. Between 0 and 255.
bluethe 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_lista list of red values for the LEDs. Index 0 of red_list corresponds to the red value of LED 0.
blue_lista list of blue values for the LEDs.
green_lista list of green values for the LEDs.
lengththe 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
numbernumber of LED to change brightness. LEDs indexed starting at 1.
brightnessvalue 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
numberthe number of LED. Indexing starts at 1.
redthe red value between 0 and 255
greenthe green value between 0 and 255
bluethe blue value between 0 and 255
Returns
bool Returns true if command written successfully, false otherwise

Member Data Documentation

◆ 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: