Skip to content

Commit cf9f5ed

Browse files
author
brentru
committed
remove prints
1 parent 12a5464 commit cf9f5ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_dymoscale.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, data_pin, units_pin, timeout=1.0):
6363
self.units_pin = DigitalInOut(units_pin)
6464
self.units_pin.switch_to_output()
6565
self.dymo = PulseIn(data_pin, maxlen=96, idle_state=True)
66+
self.tare = False
6667
self.stable = None
6768
self.units = None
6869

@@ -141,11 +142,11 @@ def get_scale_data(self):
141142
self.units = data_bytes[3]
142143
weight = data_bytes[5] + (data_bytes[6] << 8)
143144
if data_bytes[2] & 0x1:
145+
self.tare = True
144146
weight *= -1
145-
print('Tare - press the tare button to reset the scale to zero.')
146147
elif self.units == OUNCES:
147148
if data_bytes[4] & 0x80:
149+
self.tare = True
148150
data_bytes[4] -= 0x100
149-
print('Tare - press the tare button to reset the scale to zero.')
150151
weight *= 10 ** data_bytes[4]
151152
return weight

0 commit comments

Comments
 (0)