Merge pull request #242 from pimoroni/patch-scd41-demo

SCD41: Add i2c pins to MicroPython example
This commit is contained in:
Philip Howard 2022-01-27 13:09:10 +00:00 committed by GitHub
commit 08f60d81d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,10 @@ import time
import pimoroni_i2c
import breakout_scd41
i2c = pimoroni_i2c.PimoroniI2C(4, 5)
PINS_BREAKOUT_GARDEN = {"sda": 4, "scl": 5}
PINS_PICO_EXPLORER = {"sda": 20, "scl": 21}
i2c = pimoroni_i2c.PimoroniI2C(**PINS_PICO_EXPLORER)
breakout_scd41.init(i2c)
breakout_scd41.start()

View File

@ -2,6 +2,10 @@ import time
from machine import Pin, PWM, ADC
BREAKOUT_GARDEN_I2C_PINS = {"sda": 4, "scl": 5}
PICO_EXPLORER_I2C_PINS = {"sda": 20, "scl": 21}
class Analog:
def __init__(self, pin, amplifier_gain=1, resistor=0):
self.gain = amplifier_gain