Skip to content

Commit 2b94932

Browse files
authored
Merge pull request #4 from sparkfun/v0.9.1
V0.9.1
2 parents 959d013 + c0c1d9f commit 2b94932

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

examples/qwiic_keypad_ex1.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ def runExample():
8181
else:
8282
print(charButton, end="")
8383

84-
# Flush the stdout buffer to give immediate user feedback
85-
sys.stdout.flush()
84+
# Some platforms won't print until newline character, so a flush is
85+
# needed to update. However some platforms (eg. MicroPython) don't
86+
# include sys.stdout.flush(), so wrap in a try block
87+
try:
88+
sys.stdout.flush()
89+
except:
90+
pass
8691

8792
time.sleep(.25)
8893

examples/qwiic_keypad_ex3.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,13 @@ def clearEntry(userEntry):
140140
def printEntry(userEntry):
141141

142142
print("\rUserEntry:%s" % (''.join(userEntry)), end="")
143-
sys.stdout.flush()
143+
# Some platforms won't print until newline character, so a flush is
144+
# needed to update. However some platforms (eg. MicroPython) don't
145+
# include sys.stdout.flush(), so wrap in a try block
146+
try:
147+
sys.stdout.flush()
148+
except:
149+
pass
144150

145151

146152
if __name__ == '__main__':

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
# Versions should comply with PEP440. For a discussion on single-sourcing
5252
# the version across setup.py and the project code, see
5353
# http://packaging.python.org/en/latest/tutorial.html#version
54-
version='0.9.0',
54+
version='0.9.1',
5555

5656
description='SparkFun Electronics qwiic Keypad',
5757
long_description=long_description,

0 commit comments

Comments
 (0)