File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 3
3
from adafruit_ina260 import INA260 , Mode , ConversionTime
4
4
5
5
6
- if __name__ == ' __main__' :
6
+ if __name__ == " __main__" :
7
7
try :
8
8
i2c = board .I2C ()
9
9
ina260 = INA260 (i2c )
33
33
% (ina260 .current , ina260 .voltage , ina260 .power )
34
34
)
35
35
36
- # supposing meanwhile the alert limit was exceeded, setting an higher limit and clear the ALERT
36
+ # supposing meanwhile the alert limit was exceeded, setting an higher limit
37
+ # and clear the ALERT
37
38
# 0x0100 x 1,25 mA = 320 mA as alert limit
38
39
ina260 .alert_limit = 0x0100
39
40
46
47
# reset the whole chip and wait 2 sec
47
48
ina260 .reset_bit = True
48
49
time .sleep (2 )
49
- print ("MASK_REGISTER check, must be 0x0000 after reset: {}" .format (ina260 .mask_enable ))
50
+ print (
51
+ "MASK_REGISTER check, must be 0x0000 after reset: {}" .format (
52
+ ina260 .mask_enable
53
+ )
54
+ )
You can’t perform that action at this time.
0 commit comments