File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 5
5
import board
6
6
from adafruit_ina260 import INA260 , AveragingCount
7
7
8
- i2c = board .I2C ()
8
+ i2c = board .I2C () # uses board.SCL and board.SDA
9
+ # i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
9
10
ina260 = INA260 (i2c )
10
11
11
12
# Raise the averaging count to a larger number to smooth out the results
Original file line number Diff line number Diff line change 9
9
10
10
if __name__ == "__main__" :
11
11
try :
12
- i2c = board .I2C ()
12
+ i2c = board .I2C () # uses board.SCL and board.SDA
13
+ # i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector
13
14
ina260 = INA260 (i2c )
14
15
except RuntimeError as r_e :
15
16
# catch exception on init, no INA260 chip found
Original file line number Diff line number Diff line change 5
5
import board
6
6
from adafruit_ina260 import INA260 , Mode
7
7
8
- i2c = board .I2C ()
8
+ i2c = board .I2C () # uses board.SCL and board.SDA
9
+ # i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
9
10
ina260 = INA260 (i2c )
10
11
11
12
# trigger a sample
Original file line number Diff line number Diff line change 5
5
import board
6
6
import adafruit_ina260
7
7
8
- i2c = board .I2C ()
8
+ i2c = board .I2C () # uses board.SCL and board.SDA
9
+ # i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
9
10
ina260 = adafruit_ina260 .INA260 (i2c )
10
11
while True :
11
12
print (
You can’t perform that action at this time.
0 commit comments