Skip to content

Version 0.2.0

Compare
Choose a tag to compare
@Gadgetoid Gadgetoid released this 19 May 11:08
· 1962 commits to main since this release
cb958a7

AWOOGA - ⚠️ I2C devices now use the "PimoroniI2C" class ⚠️

This release includes the recent changes merged in #129

Using I2C in MicroPython now requires an instance of the PimoroniI2C class, which is created once and passed into individual breakout classes for them to use.

The PimoroniI2C class has a __del__ method and finaliser, allowing Pico's I2C to be cleaned up during soft resets. This prevents an issue where using the wrong I2C pins would break I2C on a particular channel until the Pico is hard reset. A tricky situation for a device that... doesn't have a reset button!

See the Python examples for ... well ... examples of how to use the new I2C class with breakouts. For example, here's LTR559:

from pimoroni_i2c import PimoroniI2C
from breakout_ltr559 import BreakoutLTR559

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

i2c = PimoroniI2C(**PINS_BREAKOUT_GARDEN)
ltr = BreakoutLTR559(i2c)

Eventually you'll be able to construct a PimoroniI2C

Note: This PimoroniI2C class differs from machine.I2C since it's a direct port of the I2C class used to run out breakouts in C++. Interop may be possible at some point in the future but please understand that we are not raving lunatics and are making these odd, against-the-grain design choices because we want to re-use the C++ drivers in MicroPython.

Built against MicroPython release v1.15 - https://github.com/micropython/micropython/releases/tag/v1.15

Supported Breakouts