Skip to content

Commit 791d076

Browse files
authored
Use overflow flag in example
Would have liked to implement ADC overflow detection but no flag appears to exist for it
1 parent 7a19aaf commit 791d076

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/ina219_simpletest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@
4242
print("Power Register : {:6.3f} W".format(power))
4343
print("")
4444

45+
# Check internal calculations haven't overflowed (doesn't detect ADC overflows)
46+
if ina219.overflow:
47+
print("Internal Math Overflow Detected!")
48+
print("")
49+
4550
time.sleep(2)

0 commit comments

Comments
 (0)