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.
2 parents 19a0e73 + e2e7567 commit 025d6b7Copy full SHA for 025d6b7
adafruit_dymoscale.py
@@ -99,12 +99,10 @@ def get_scale_data(self):
99
bits = [0] * 96 # there are 12 bytes = 96 bits of data
100
bit_idx = 0 # we will count a bit at a time
101
bit_val = False # first pulses will be LOW
102
- for i in range(len(self.dymo)):
103
- if self.dymo[i] == 65535: # check for the pulse between transmits
+ for i in self.dymo:
+ if i == 65535: # check for the pulse between transmits
104
break
105
- num_bits = int(
106
- self.dymo[i] / PULSE_WIDTH + 0.5
107
- ) # ~14KHz == ~7.5us per clock
+ num_bits = int(i / PULSE_WIDTH + 0.5) # ~14KHz == ~7.5us per clock
108
bit = 0
109
while bit < num_bits:
110
bits[bit_idx] = bit_val
0 commit comments