Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/qwiic_alphanumeric_ex01_print_string.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
21 changes: 12 additions & 9 deletions examples/qwiic_alphanumeric_ex03_print_char.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 12 additions & 9 deletions examples/qwiic_alphanumeric_ex04_set_brightness.py
Original file line number Diff line number Diff line change
@@ -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.
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
8 changes: 4 additions & 4 deletions examples/qwiic_alphanumeric_ex05_set_blink_rate.py
Original file line number Diff line number Diff line change
@@ -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.
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
8 changes: 4 additions & 4 deletions examples/qwiic_alphanumeric_ex06_colon_and_decimal.py
Original file line number Diff line number Diff line change
@@ -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.
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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)
8 changes: 4 additions & 4 deletions examples/qwiic_alphanumeric_ex07_unknown_char.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
8 changes: 4 additions & 4 deletions examples/qwiic_alphanumeric_ex08_multi_display.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
11 changes: 6 additions & 5 deletions examples/qwiic_alphanumeric_ex09_scrolling_string.py
Original file line number Diff line number Diff line change
@@ -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.
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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)
2 changes: 1 addition & 1 deletion qwiic_alphanumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down