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_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 038dcfd..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: @@ -56,18 +56,21 @@ 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 (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) - my_display.display_print("Milk") - time.sleep(1) + time.sleep(0.1) if __name__ == '__main__': 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 0359ae2..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: @@ -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 @@ -68,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) 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 """ 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,