Skip to content

Commit

Permalink
Merge pull request #49 from FoamyGuy/new_address
Browse files Browse the repository at this point in the history
try new I2C address in examples
  • Loading branch information
FoamyGuy authored Feb 13, 2025
2 parents 4e6ba64 + 9647753 commit 8edb395
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion examples/mlx90393_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@

i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
SENSOR = adafruit_mlx90393.MLX90393(i2c, gain=adafruit_mlx90393.GAIN_1X)
try:
SENSOR = adafruit_mlx90393.MLX90393(i2c, gain=adafruit_mlx90393.GAIN_1X)
except ValueError:
SENSOR = adafruit_mlx90393.MLX90393(
i2c, gain=adafruit_mlx90393.GAIN_1X, address=0x18
)

while True:
MX, MY, MZ = SENSOR.magnetic
Expand Down
7 changes: 6 additions & 1 deletion examples/mlx90393_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@

i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
SENSOR = adafruit_mlx90393.MLX90393(i2c, gain=adafruit_mlx90393.GAIN_1X)
try:
SENSOR = adafruit_mlx90393.MLX90393(i2c, gain=adafruit_mlx90393.GAIN_1X)
except ValueError:
SENSOR = adafruit_mlx90393.MLX90393(
i2c, gain=adafruit_mlx90393.GAIN_1X, address=0x18
)


while True:
Expand Down

0 comments on commit 8edb395

Please sign in to comment.