Skip to content

Commit

Permalink
hx71x: wip - export values on API server as floating point numbers
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Jun 14, 2024
1 parent b38c055 commit 4943ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion klippy/extras/hx71x.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ def add_client(self, callback):

# Measurement decoding
def _convert_samples(self, samples):
adc_factor = 1. / (1<<23)
count = 0
for ptime, val in samples:
if val == SAMPLE_ERROR:
self.last_error_count += 1
continue
samples[count] = (round(ptime, 6), val)
samples[count] = (round(ptime, 6), round(val * adc_factor, 9))
count += 1
del samples[count:]

Expand Down

0 comments on commit 4943ab0

Please sign in to comment.