From af67f57be8da76967a9f96a4bb529f157a02fa7c Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Thu, 2 Nov 2023 15:07:02 -0600 Subject: [PATCH 1/5] Bump version number to v0.0.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 189ef80..5ab066f 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # http://packaging.python.org/en/latest/tutorial.html#version - version='0.0.1', + version='0.0.2', description='SparkFun Electronics qwiic alphanumeric package', long_description=long_description, From a8c014fcfeff81143e355b94ec67d6d83cb3852f Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Thu, 2 Nov 2023 15:08:27 -0600 Subject: [PATCH 2/5] Fix typo in Example 3 display_print() isn't the right function, should just be print() --- examples/qwiic_alphanumeric_ex04_set_brightness.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/qwiic_alphanumeric_ex04_set_brightness.py b/examples/qwiic_alphanumeric_ex04_set_brightness.py index 038dcfd..2f2ab41 100644 --- a/examples/qwiic_alphanumeric_ex04_set_brightness.py +++ b/examples/qwiic_alphanumeric_ex04_set_brightness.py @@ -62,8 +62,8 @@ def run_example(): # So, the acceptable inputs to this function are ints between 0 (display off) # and 15 (full brightness) my_display.set_brightness(i) - my_display.display_print("Milk") time.sleep(1) + my_display.print("Milk") if __name__ == '__main__': try: From 5b7425d6b81969b28236efa2a90821956fae5440 Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Thu, 2 Nov 2023 15:09:23 -0600 Subject: [PATCH 3/5] Fix set_brightness() comments 0 is not off, it's 1/16 brightness --- examples/qwiic_alphanumeric_ex04_set_brightness.py | 4 ++-- qwiic_alphanumeric.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/qwiic_alphanumeric_ex04_set_brightness.py b/examples/qwiic_alphanumeric_ex04_set_brightness.py index 2f2ab41..8d6a3ad 100644 --- a/examples/qwiic_alphanumeric_ex04_set_brightness.py +++ b/examples/qwiic_alphanumeric_ex04_set_brightness.py @@ -59,8 +59,8 @@ def run_example(): while True: for i in range(0, 16): # The input to set_brightness() is a duty cycle over 16 - # So, the acceptable inputs to this function are ints between 0 (display off) - # and 15 (full brightness) + # So, the acceptable inputs to this function are ints between 0 + # (1/16 brightness) and 15 (full brightness) my_display.set_brightness(i) time.sleep(1) my_display.print("Milk") diff --git a/qwiic_alphanumeric.py b/qwiic_alphanumeric.py index 8faba74..b0179c9 100755 --- a/qwiic_alphanumeric.py +++ b/qwiic_alphanumeric.py @@ -476,7 +476,7 @@ def set_brightness(self, duty): This function sets the brightness of all displays on the bus. Duty cycle over 16. - :param duty: Valid between 0 (display off) and 15 (full brightness) + :param duty: Valid between 0 (1/16 brightnss) and 15 (full brightness) :return: True if brightness is successfully updated, false otherwise. :rtype: bool """ From 77ac853d001341cf6850c8d4da156a27730c25f3 Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Thu, 2 Nov 2023 15:18:49 -0600 Subject: [PATCH 4/5] Tweak Examples 3, 4, and 9 Example 3 - Print all characters on each digit rapidly Example 4 - Cycle brightness a few times more rapidly, only print text once Example 9 - Only shift 8 times, not infinitely --- .../qwiic_alphanumeric_ex03_print_char.py | 21 +++++++++++-------- .../qwiic_alphanumeric_ex04_set_brightness.py | 9 +++++--- ...wiic_alphanumeric_ex09_scrolling_string.py | 3 ++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/examples/qwiic_alphanumeric_ex03_print_char.py b/examples/qwiic_alphanumeric_ex03_print_char.py index 9c5dd13..e6c4809 100755 --- a/examples/qwiic_alphanumeric_ex03_print_char.py +++ b/examples/qwiic_alphanumeric_ex03_print_char.py @@ -62,16 +62,19 @@ def run_example(): my_display.print_char('T', 3) my_display.update_display() + + time.sleep(1) - # # Un comment these lines if you want to see all available characters - # # Print to every digit of a given display - # for digit_num in range(0, 4): - # for i in range(ord(' '), ord('~')): - # if i is not ord(':') or ord('.'): - # my_display.print_char(chr(i), digit_num) - # my_display.update_display() - # time.sleep(1) - # my_display.clear() + # Display all available characters + for i in range(ord(' '), ord('~')): + if i is not ord(':') or ord('.'): + my_display.print_char(chr(i), 0) + my_display.print_char(chr(i), 1) + my_display.print_char(chr(i), 2) + my_display.print_char(chr(i), 3) + my_display.update_display() + time.sleep(0.1) + my_display.clear() if __name__ == '__main__': try: diff --git a/examples/qwiic_alphanumeric_ex04_set_brightness.py b/examples/qwiic_alphanumeric_ex04_set_brightness.py index 8d6a3ad..b31ee20 100644 --- a/examples/qwiic_alphanumeric_ex04_set_brightness.py +++ b/examples/qwiic_alphanumeric_ex04_set_brightness.py @@ -56,14 +56,17 @@ def run_example(): print("\nQwiic Alphanumeric Ready!") - while True: + my_display.print("Milk") + + # Repeat a few times + for i in range(4): + # Loop through all brightness settings for i in range(0, 16): # The input to set_brightness() is a duty cycle over 16 # So, the acceptable inputs to this function are ints between 0 # (1/16 brightness) and 15 (full brightness) my_display.set_brightness(i) - time.sleep(1) - my_display.print("Milk") + time.sleep(0.1) if __name__ == '__main__': try: diff --git a/examples/qwiic_alphanumeric_ex09_scrolling_string.py b/examples/qwiic_alphanumeric_ex09_scrolling_string.py index 0359ae2..e0d0265 100644 --- a/examples/qwiic_alphanumeric_ex09_scrolling_string.py +++ b/examples/qwiic_alphanumeric_ex09_scrolling_string.py @@ -58,7 +58,8 @@ def run_example(): my_display.print("GET MILK") - while 1: + # Loop through all 8 characters + for i in range(8): time.sleep(1) my_display.shift_left() # Alternatively - you could also shift the string to the right From 0bb18cc0166103ac69612a31e885ec65f044f076 Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Thu, 2 Nov 2023 15:23:14 -0600 Subject: [PATCH 5/5] Fix example indices Several examples had comments and print statements with the wrong example index --- examples/qwiic_alphanumeric_ex01_print_string.py | 8 ++++---- examples/qwiic_alphanumeric_ex04_set_brightness.py | 8 ++++---- examples/qwiic_alphanumeric_ex05_set_blink_rate.py | 8 ++++---- examples/qwiic_alphanumeric_ex06_colon_and_decimal.py | 8 ++++---- examples/qwiic_alphanumeric_ex07_unknown_char.py | 8 ++++---- examples/qwiic_alphanumeric_ex08_multi_display.py | 8 ++++---- examples/qwiic_alphanumeric_ex09_scrolling_string.py | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/examples/qwiic_alphanumeric_ex01_print_string.py b/examples/qwiic_alphanumeric_ex01_print_string.py index ef2f086..da70f72 100644 --- a/examples/qwiic_alphanumeric_ex01_print_string.py +++ b/examples/qwiic_alphanumeric_ex01_print_string.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex4_print_string.py +# qwiic_alphanumeric_ex1_print_string.py # # This example shows how to use the print() function to illuminate strings # on the alphanumeric display. @@ -38,7 +38,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 4 +# Example 1 from __future__ import print_function import qwiic_alphanumeric @@ -47,7 +47,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 4: Print String") + print("\nSparkFun Qwiic Alphanumeric - Example 1: Print String") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin() == False: @@ -63,5 +63,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 4") + print("\nEnding Example 1") sys.exit(0) diff --git a/examples/qwiic_alphanumeric_ex04_set_brightness.py b/examples/qwiic_alphanumeric_ex04_set_brightness.py index b31ee20..ae848d0 100644 --- a/examples/qwiic_alphanumeric_ex04_set_brightness.py +++ b/examples/qwiic_alphanumeric_ex04_set_brightness.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex5_set_brightness.py +# qwiic_alphanumeric_ex4_set_brightness.py # # This example sets the brightness of the Qwiic Alphanumeric display. # ---------------------------------------------------------------------- @@ -37,7 +37,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 5 +# Example 4 from __future__ import print_function import qwiic_alphanumeric @@ -46,7 +46,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 5: Set Brightness") + print("\nSparkFun Qwiic Alphanumeric - Example 4: Set Brightness") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin() == False: @@ -72,5 +72,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 5") + print("\nEnding Example 4") sys.exit(0) diff --git a/examples/qwiic_alphanumeric_ex05_set_blink_rate.py b/examples/qwiic_alphanumeric_ex05_set_blink_rate.py index bc256cb..6b37868 100644 --- a/examples/qwiic_alphanumeric_ex05_set_blink_rate.py +++ b/examples/qwiic_alphanumeric_ex05_set_blink_rate.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex6_set_blink_rate.py +# qwiic_alphanumeric_ex5_set_blink_rate.py # # This example sets the blink rate of the display. # ---------------------------------------------------------------------- @@ -37,7 +37,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 6 +# Example 5 from __future__ import print_function import qwiic_alphanumeric @@ -46,7 +46,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 6: Set Blink Rate") + print("\nSparkFun Qwiic Alphanumeric - Example 5: Set Blink Rate") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin() == False: @@ -66,5 +66,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 6") + print("\nEnding Example 5") sys.exit(0) diff --git a/examples/qwiic_alphanumeric_ex06_colon_and_decimal.py b/examples/qwiic_alphanumeric_ex06_colon_and_decimal.py index e026835..9cb236c 100644 --- a/examples/qwiic_alphanumeric_ex06_colon_and_decimal.py +++ b/examples/qwiic_alphanumeric_ex06_colon_and_decimal.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex7_colon_and_decimal .py +# qwiic_alphanumeric_ex6_colon_and_decimal .py # # This example tests the library's response to printing colons or decimal points. # ---------------------------------------------------------------------- @@ -37,7 +37,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 7 +# Example 6 from __future__ import print_function import qwiic_alphanumeric @@ -46,7 +46,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 7: Colon and Decimal") + print("\nSparkFun Qwiic Alphanumeric - Example 6: Colon and Decimal") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin() == False: @@ -74,5 +74,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 7") + print("\nEnding Example 6") sys.exit(0) diff --git a/examples/qwiic_alphanumeric_ex07_unknown_char.py b/examples/qwiic_alphanumeric_ex07_unknown_char.py index 3ee92f6..6efbf37 100644 --- a/examples/qwiic_alphanumeric_ex07_unknown_char.py +++ b/examples/qwiic_alphanumeric_ex07_unknown_char.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex8_unknown_char.py +# qwiic_alphanumeric_ex7_unknown_char.py # # This example demonstrates what the library does when the user tries to # print an unknown character. @@ -38,7 +38,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 8 +# Example 7 from __future__ import print_function import qwiic_alphanumeric @@ -47,7 +47,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 8: Unkown Char") + print("\nSparkFun Qwiic Alphanumeric - Example 7: Unkown Char") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin() == False: @@ -65,5 +65,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 8") + print("\nEnding Example 7") sys.exit(0) diff --git a/examples/qwiic_alphanumeric_ex08_multi_display.py b/examples/qwiic_alphanumeric_ex08_multi_display.py index 31d9c80..0e8441e 100644 --- a/examples/qwiic_alphanumeric_ex08_multi_display.py +++ b/examples/qwiic_alphanumeric_ex08_multi_display.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex9_multi_display.py +# qwiic_alphanumeric_ex8_multi_display.py # # This example demonstrates how to connect multiple displays to the bus # to print longer strings. @@ -38,7 +38,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 9 +# Example 8 from __future__ import print_function import qwiic_alphanumeric @@ -47,7 +47,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 9: Multi Display") + print("\nSparkFun Qwiic Alphanumeric - Example 8: Multi Display") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin(0x70, 0x71) == False: @@ -63,5 +63,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 9") + print("\nEnding Example 8") sys.exit(0) diff --git a/examples/qwiic_alphanumeric_ex09_scrolling_string.py b/examples/qwiic_alphanumeric_ex09_scrolling_string.py index e0d0265..32f8579 100644 --- a/examples/qwiic_alphanumeric_ex09_scrolling_string.py +++ b/examples/qwiic_alphanumeric_ex09_scrolling_string.py @@ -1,6 +1,6 @@ # !/usr/bin/env python # ---------------------------------------------------------------------- -# qwiic_alphanumeric_ex10_scrolling_string.py +# qwiic_alphanumeric_ex9_scrolling_string.py # # This example tests the scrolling functionality of the display. # ---------------------------------------------------------------------- @@ -37,7 +37,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #======================================================================= -# Example 10 +# Example 9 from __future__ import print_function import qwiic_alphanumeric @@ -46,7 +46,7 @@ def run_example(): - print("\nSparkFun Qwiic Alphanumeric - Example 10: Scrolling String") + print("\nSparkFun Qwiic Alphanumeric - Example 9: Scrolling String") my_display = qwiic_alphanumeric.QwiicAlphanumeric() if my_display.begin(0x70, 0x71) == False: @@ -69,5 +69,5 @@ def run_example(): try: run_example() except (KeyboardInterrupt, SystemExit) as exErr: - print("\nEnding Example 10") + print("\nEnding Example 9") sys.exit(0)