Skip to content

Commit

Permalink
Use I2C pins constants for #351
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed May 12, 2022
1 parent aa75a7b commit af802c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions micropython/examples/pico_explorer/weatherstation_BME280.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from breakout_bme280 import BreakoutBME280
from pimoroni_i2c import PimoroniI2C
from pimoroni import PICO_EXPLORER_I2C_PINS

# Pico Explorer boilerplate
import picoexplorer as display
Expand All @@ -12,10 +13,7 @@
display_buffer = bytearray(width * height * 2)
display.init(display_buffer)

PINS_BREAKOUT_GARDEN = {"sda": 4, "scl": 5}
PINS_PICO_EXPLORER = {"sda": 20, "scl": 21}

i2c = PimoroniI2C(**PINS_PICO_EXPLORER)
i2c = PimoroniI2C(**PICO_EXPLORER_I2C_PINS)
bme = BreakoutBME280(i2c)

# lets set up some pen colours to make drawing easier
Expand Down
6 changes: 2 additions & 4 deletions micropython/examples/pico_explorer/weatherstation_BME68X.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from breakout_bme68x import BreakoutBME68X
from pimoroni_i2c import PimoroniI2C
from pimoroni import PICO_EXPLORER_I2C_PINS

# Pico Explorer boilerplate
import picoexplorer as display
Expand All @@ -12,10 +13,7 @@
display_buffer = bytearray(width * height * 2)
display.init(display_buffer)

PINS_BREAKOUT_GARDEN = {"sda": 4, "scl": 5}
PINS_PICO_EXPLORER = {"sda": 20, "scl": 21}

i2c = PimoroniI2C(**PINS_PICO_EXPLORER)
i2c = PimoroniI2C(**PICO_EXPLORER_I2C_PINS)
bme = BreakoutBME68X(i2c)

# lets set up some pen colours to make drawing easier
Expand Down

0 comments on commit af802c8

Please sign in to comment.