Skip to content

Commit 9aea5e4

Browse files
author
brentru
committed
update exmple for PR
1 parent c175a9f commit 9aea5e4

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

examples/dymoscale_simpletest.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@
55
dymo = Scale(board.D3, board.D4)
66

77
while True:
8-
dymo.get_scale_data()
9-
if dymo.units == 'oz':
10-
text = "%0.1f oz" % dymo.weight
11-
if dymo.units == 'g':
12-
text = "%0.1f g" % dymo.weight
13-
print(text)
14-
8+
print("{:0.1f} {}".format(dymo.weight, dymo.units))
159
# to avoid sleep mode, we'll toggle the units pin.
16-
17-
# if we don't want to switch the unit on the next read:
10+
# if we don't want to switch the units on the next read...
1811
dymo.toggle_unit_button()
1912

20-
# if we want to switch the measurement unit on the next read
21-
# dymo.toggle_unit_button(switch_unit=True)
13+
# if we do want to switch the units on the next read...
14+
# dymo.toggle_unit_button(switch_units=True)

0 commit comments

Comments
 (0)