We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c175a9f commit 9aea5e4Copy full SHA for 9aea5e4
examples/dymoscale_simpletest.py
@@ -5,17 +5,10 @@
5
dymo = Scale(board.D3, board.D4)
6
7
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
-
+ print("{:0.1f} {}".format(dymo.weight, dymo.units))
15
# 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:
+ # if we don't want to switch the units on the next read...
18
dymo.toggle_unit_button()
19
20
- # if we want to switch the measurement unit on the next read
21
- # dymo.toggle_unit_button(switch_unit=True)
+ # if we do want to switch the units on the next read...
+ # dymo.toggle_unit_button(switch_units=True)
0 commit comments