Skip to content
Merged
Prev Previous commit
Next Next commit
reformat after black
  • Loading branch information
gpongelli committed Feb 16, 2021
commit 5ce28203ea8eba528c3c999e42ddf8696eb30bd4
11 changes: 8 additions & 3 deletions examples/ina260_latch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from adafruit_ina260 import INA260, Mode, ConversionTime


if __name__ == '__main__':
if __name__ == "__main__":
try:
i2c = board.I2C()
ina260 = INA260(i2c)
Expand Down Expand Up @@ -33,7 +33,8 @@
% (ina260.current, ina260.voltage, ina260.power)
)

# supposing meanwhile the alert limit was exceeded, setting an higher limit and clear the ALERT
# supposing meanwhile the alert limit was exceeded, setting an higher limit
# and clear the ALERT
# 0x0100 x 1,25 mA = 320 mA as alert limit
ina260.alert_limit = 0x0100

Expand All @@ -46,4 +47,8 @@
# reset the whole chip and wait 2 sec
ina260.reset_bit = True
time.sleep(2)
print("MASK_REGISTER check, must be 0x0000 after reset: {}".format(ina260.mask_enable))
print(
"MASK_REGISTER check, must be 0x0000 after reset: {}".format(
ina260.mask_enable
)
)