![]() |
Qwiic_Alphanumeric_Py
Python for SFE Qwiic Alphanumeric
|
Public Member Functions | |
def | __init__ (self, address=None, i2c_driver=None) |
def | begin (self, address_display_one=_QWIIC_ALPHANUMERIC_DEFAULT_ADDRESS, address_display_two=DEFAULT_NOTHING_ATTACHED, address_display_three=DEFAULT_NOTHING_ATTACHED, address_display_four=DEFAULT_NOTHING_ATTACHED) |
Initialize the operation of the Qwiic Alphanumeric. More... | |
def | is_connected (self, display_number) |
Check that dispplays are responding on the I2C bus. More... | |
def | initialize (self) |
Run through initialization sequence for each display connected on the I2C bus Enable clocks, set brightness default to full brightness, turn off blinking, and turn all displays on. More... | |
def | enable_system_clock (self) |
Turn on the system oscillator for all displays on the I2C bus. More... | |
def | disable_system_clock (self) |
Turn off the system oscillator for all displays on the bus. More... | |
def | enable_system_clock_single (self, display_number) |
Turn on the system oscillator for normal operation mode. More... | |
def | disable_system_clock_single (self, display_number) |
Turn off the system oscillator for standby mode. More... | |
def | look_up_display_address (self, display_number) |
This function connects the display number to its coressponding address. More... | |
def | clear (self) |
Turn off all segments of all displays connected to bus. More... | |
def | set_brightness (self, duty) |
This function sets the brightness of all displays on the bus. More... | |
def | set_brightness_single (self, display_number, duty) |
Set the brightness of a single display. More... | |
def | set_blink_rate (self, rate) |
Set the blink rate of all displays on the bus as defined by the datasheet. More... | |
def | set_blink_rate_single (self, display_number, rate) |
Set the blink rate of a single display on the bus. More... | |
def | display_on_single (self, display_number) |
Turn a single alphanumeric display on. More... | |
def | display_off_single (self, display_number) |
Turn a single alphanumeric display off. More... | |
def | set_display_on_off (self, display_number, turn_on_display) |
Set or clear the display on/off bit of a given display number. More... | |
def | display_on (self) |
Turn on all displays on the I2C bus. More... | |
def | display_off (self) |
Turn off all displays on the I2C bus. More... | |
def | decimal_on_single (self, display_number) |
Turn the decimal point on for a single display. More... | |
def | decimal_off_single (self, display_number) |
Turn the decimal point off for a single display. More... | |
def | set_decimal_on_off (self, display_number, turn_on_decimal) |
Set or clear the decimal on/off bit. More... | |
def | decimal_on (self) |
Turn the decimal on for all displays on the bus. More... | |
def | decimal_off (self) |
Turn the decimal point off for all displays on the bus. More... | |
def | colon_on_single (self, display_number) |
Turn the colon on for a single display. More... | |
def | colon_off_single (self, display_number) |
Turn the colon off for a single display. More... | |
def | set_colon_on_off (self, display_number, turn_on_colon) |
Set or clear the colon on/off bit. More... | |
def | colon_on (self) |
Turn the colon on for all displays on the bus. More... | |
def | colon_off (self) |
Turn the colon off for all displays on the bus. More... | |
def | illuminate_segment (self, segment, digit) |
Given a segment and a digit, set the matching bit within the RAM of the Holtek RAM set. More... | |
def | illuminate_char (self, segments_to_turn_on, digit) |
Fiven a binary set of segments and a digit, store this data into the RAM array. More... | |
def | print_char (self, display_char, digit) |
Print a character, for a given digit, on display. More... | |
def | print (self, print_string) |
Print a whole string to the alphanumeric display(s) More... | |
def | update_display (self) |
Push the contents of display_RAM out on to the various displays in 16 byte chunks. More... | |
def | shift_right (self, shift_amt=1) |
Shift the display content to the right a number of digits. More... | |
def | shift_left (self, shift_amt=1) |
Shift the display content to the left a number of digits. More... | |
def | write_RAM (self, address, reg, buff) |
Write LED updates to the RAM of the LED driver IC. More... | |
def | write_RAM_byte (self, address, data_to_write) |
Public Attributes | |
address | |
number_of_displays | |
digit_position | |
display_on_off | |
decimal_on_off | |
colon_on_off | |
Static Public Attributes | |
device_name = _DEFAULT_NAME | |
available_addresses = _AVAILABLE_I2C_ADDRESS | |
int | DEFAULT_NOTHING_ATTACHED = 0xFF |
int | SEG_A = 0x0001 |
int | SEG_B = 0x0002 |
int | SEG_C = 0x0004 |
int | SEG_D = 0x0008 |
int | SEG_E = 0x0010 |
int | SEG_F = 0x0020 |
int | SEG_G = 0x0040 |
int | SEG_H = 0x0080 |
int | SEG_I = 0x0100 |
int | SEG_J = 0x0200 |
int | SEG_K = 0x0400 |
int | SEG_L = 0x0800 |
int | SEG_M = 0x1000 |
int | SEG_N = 0x2000 |
int | ALPHA_BLINK_RATE_NOBLINK = 0b00 |
int | ALPHA_BLINK_RATE_2HZ = 0b01 |
int | ALPHA_BLINK_RATE_1HZ = 0b10 |
int | ALPHA_BLINK_RATE_0_5HZ = 0b11 |
int | ALPHA_DISPLAY_ON = 0b1 |
int | ALPHA_DISPLAY_OFF = 0b0 |
int | ALPHA_DECIMAL_ON = 0b1 |
int | ALPHA_DECIMAL_OFF = 0b0 |
int | ALPHA_COLON_ON = 0b1 |
int | ALPHA_COLON_OFF = 0b0 |
int | ALPHA_CMD_SYSTEM_SETUP = 0b00100000 |
int | ALPHA_CMD_DISPLAY_SETUP = 0b10000000 |
int | ALPHA_CMD_DIMMING_SETUP = 0b11100000 |
int | SFE_ALPHANUM_UNKNOWN_CHAR = 95 |
list | alphanumeric_segs = [] |
int | digit_position = 0 |
int | number_of_displays = 1 |
int | display_on_off = 0 |
int | decimal_on_off = 0 |
int | colon_on_off = 0 |
int | blink_rate = ALPHA_BLINK_RATE_NOBLINK |
list | display_RAM = [0] * 16 * 4 |
list | display_content = [' '] * (4 * 4 + 1) |
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. |
def qwiic_alphanumeric.QwiicAlphanumeric.__init__ | ( | self, | |
address = None , |
|||
i2c_driver = None |
|||
) |
def qwiic_alphanumeric.QwiicAlphanumeric.begin | ( | self, | |
address_display_one = _QWIIC_ALPHANUMERIC_DEFAULT_ADDRESS , |
|||
address_display_two = DEFAULT_NOTHING_ATTACHED , |
|||
address_display_three = DEFAULT_NOTHING_ATTACHED , |
|||
address_display_four = DEFAULT_NOTHING_ATTACHED |
|||
) |
Initialize the operation of the Qwiic Alphanumeric.
Assign addresses to displays and determine the number of displays connected to the bus. Run is_connected(). Initialize and clear displays.
address_display_one | I2C address of first display |
address_display_two | I2C address of the second display |
address_dispplay_three | I2C address of the third display |
address_display_four | I2C address of the fourth display |
def qwiic_alphanumeric.QwiicAlphanumeric.clear | ( | self | ) |
Turn off all segments of all displays connected to bus.
def qwiic_alphanumeric.QwiicAlphanumeric.colon_off | ( | self | ) |
Turn the colon off for all displays on the bus.
def qwiic_alphanumeric.QwiicAlphanumeric.colon_off_single | ( | self, | |
display_number | |||
) |
Turn the colon off for a single display.
display_number | number of display to update. |
def qwiic_alphanumeric.QwiicAlphanumeric.colon_on | ( | self | ) |
Turn the colon on for all displays on the bus.
def qwiic_alphanumeric.QwiicAlphanumeric.colon_on_single | ( | self, | |
display_number | |||
) |
Turn the colon on for a single display.
display_number | number of display to update. |
def qwiic_alphanumeric.QwiicAlphanumeric.decimal_off | ( | self | ) |
Turn the decimal point off for all displays on the bus.
def qwiic_alphanumeric.QwiicAlphanumeric.decimal_off_single | ( | self, | |
display_number | |||
) |
Turn the decimal point off for a single display.
display_number | the number of display to turn the decimal point off for. |
def qwiic_alphanumeric.QwiicAlphanumeric.decimal_on | ( | self | ) |
Turn the decimal on for all displays on the bus.
def qwiic_alphanumeric.QwiicAlphanumeric.decimal_on_single | ( | self, | |
display_number | |||
) |
Turn the decimal point on for a single display.
display_number | the number of display to turn the decimal on for. |
def qwiic_alphanumeric.QwiicAlphanumeric.disable_system_clock | ( | self | ) |
Turn off the system oscillator for all displays on the bus.
def qwiic_alphanumeric.QwiicAlphanumeric.disable_system_clock_single | ( | self, | |
display_number | |||
) |
Turn off the system oscillator for standby mode.
display_number | number of display on I2C bus to disable the system clock for. |
def qwiic_alphanumeric.QwiicAlphanumeric.display_off | ( | self | ) |
Turn off all displays on the I2C bus.
def qwiic_alphanumeric.QwiicAlphanumeric.display_off_single | ( | self, | |
display_number | |||
) |
Turn a single alphanumeric display off.
display_number | the number of display to be updated |
def qwiic_alphanumeric.QwiicAlphanumeric.display_on | ( | self | ) |
Turn on all displays on the I2C bus.
def qwiic_alphanumeric.QwiicAlphanumeric.display_on_single | ( | self, | |
display_number | |||
) |
Turn a single alphanumeric display on.
display_number | the number of display to be updated |
def qwiic_alphanumeric.QwiicAlphanumeric.enable_system_clock | ( | self | ) |
Turn on the system oscillator for all displays on the I2C bus.
def qwiic_alphanumeric.QwiicAlphanumeric.enable_system_clock_single | ( | self, | |
display_number | |||
) |
Turn on the system oscillator for normal operation mode.
display_number | number of display on I2C bus to enable the system clock for. |
def qwiic_alphanumeric.QwiicAlphanumeric.illuminate_char | ( | self, | |
segments_to_turn_on, | |||
digit | |||
) |
Fiven a binary set of segments and a digit, store this data into the RAM array.
segments_to_turn_on | list of segments to illuminate which create an alphanumeric character |
digit | digit on which to illuminate this char (list of segments) |
def qwiic_alphanumeric.QwiicAlphanumeric.illuminate_segment | ( | self, | |
segment, | |||
digit | |||
) |
Given a segment and a digit, set the matching bit within the RAM of the Holtek RAM set.
segment | the segment to illuminate. There are 14 segments available, so A-N |
digit | the digit on the display to turn the segment on. There are 4 digits per display |
def qwiic_alphanumeric.QwiicAlphanumeric.initialize | ( | self | ) |
Run through initialization sequence for each display connected on the I2C bus Enable clocks, set brightness default to full brightness, turn off blinking, and turn all displays on.
def qwiic_alphanumeric.QwiicAlphanumeric.is_connected | ( | self, | |
display_number | |||
) |
Check that dispplays are responding on the I2C bus.
display_number | The number of the display on the bus |
def qwiic_alphanumeric.QwiicAlphanumeric.look_up_display_address | ( | self, | |
display_number | |||
) |
This function connects the display number to its coressponding address.
display_number | number of display on I2C bus. The left-most display is zero and display number increments by 1 with each additional display on bus. |
def qwiic_alphanumeric.QwiicAlphanumeric.print | ( | self, | |
print_string | |||
) |
Print a whole string to the alphanumeric display(s)
print_string | string to be printed |
def qwiic_alphanumeric.QwiicAlphanumeric.print_char | ( | self, | |
display_char, | |||
digit | |||
) |
Print a character, for a given digit, on display.
display_char | the character to be printed to display |
digit | the digit position where character should be printed |
def qwiic_alphanumeric.QwiicAlphanumeric.set_blink_rate | ( | self, | |
rate | |||
) |
Set the blink rate of all displays on the bus as defined by the datasheet.
rate | Blink frequency in Hz. Valid options are defined by datasheet: 2.0, 1.0, or 0.5 Hz. Any other input to this function will result in steady alphanumeric display (no blink). |
def qwiic_alphanumeric.QwiicAlphanumeric.set_blink_rate_single | ( | self, | |
display_number, | |||
rate | |||
) |
Set the blink rate of a single display on the bus.
display_number | the number of display to be updated |
rate | Blink frequency in Hz. Valid options are defined by datasheet: 2.0, 1.0, or 0.5 Hz. Any other input to this function will result in steady alphanumeric display (no blink). |
def qwiic_alphanumeric.QwiicAlphanumeric.set_brightness | ( | self, | |
duty | |||
) |
This function sets the brightness of all displays on the bus.
Duty cycle over 16.
duty | Valid between 0 (1/16 brightnss) and 15 (full brightness) |
def qwiic_alphanumeric.QwiicAlphanumeric.set_brightness_single | ( | self, | |
display_number, | |||
duty | |||
) |
Set the brightness of a single display.
display_number | The number of display on the I2C bus. |
duty | Over 16. Valid between 0 (display off) and 15 (full brightness) |
def qwiic_alphanumeric.QwiicAlphanumeric.set_colon_on_off | ( | self, | |
display_number, | |||
turn_on_colon | |||
) |
Set or clear the colon on/off bit.
display_number | number of display to update. |
turn_on_colon | boolean variable. If true, colon will turn on. If false, colon will turn off. |
def qwiic_alphanumeric.QwiicAlphanumeric.set_decimal_on_off | ( | self, | |
display_number, | |||
turn_on_decimal | |||
) |
Set or clear the decimal on/off bit.
display_number | the number of display to update. |
turn_on_decimal | boolean variable. If true, will turn decimal on. If false, will turn decimal off. |
def qwiic_alphanumeric.QwiicAlphanumeric.set_display_on_off | ( | self, | |
display_number, | |||
turn_on_display | |||
) |
Set or clear the display on/off bit of a given display number.
display_number | the number of display to be updated |
turn_on_display | boolean variable. If true, will turn display on. If false, will turn display off |
def qwiic_alphanumeric.QwiicAlphanumeric.shift_left | ( | self, | |
shift_amt = 1 |
|||
) |
Shift the display content to the left a number of digits.
shift_amt | the number of digits to shift the string |
def qwiic_alphanumeric.QwiicAlphanumeric.shift_right | ( | self, | |
shift_amt = 1 |
|||
) |
Shift the display content to the right a number of digits.
shift_amt | the number of digits to shift the string |
def qwiic_alphanumeric.QwiicAlphanumeric.update_display | ( | self | ) |
Push the contents of display_RAM out on to the various displays in 16 byte chunks.
def qwiic_alphanumeric.QwiicAlphanumeric.write_RAM | ( | self, | |
address, | |||
reg, | |||
buff | |||
) |
Write LED updates to the RAM of the LED driver IC.
address | I2C address of the display |
reg | the location in RAM to write to |
buff | the bytes to be written |
def qwiic_alphanumeric.QwiicAlphanumeric.write_RAM_byte | ( | self, | |
address, | |||
data_to_write | |||
) |
qwiic_alphanumeric.QwiicAlphanumeric.address |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
qwiic_alphanumeric.QwiicAlphanumeric.colon_on_off |
|
static |
qwiic_alphanumeric.QwiicAlphanumeric.decimal_on_off |
|
static |
|
static |
|
static |
qwiic_alphanumeric.QwiicAlphanumeric.digit_position |
|
static |
|
static |
qwiic_alphanumeric.QwiicAlphanumeric.display_on_off |
|
static |
|
static |
qwiic_alphanumeric.QwiicAlphanumeric.number_of_displays |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |