Skip to content

plugowski/MicroPython_TCA9548A

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

MicroPython driver for the TCA9548A I2C Multiplexer based on Adafruit CircuitPython TCA9548A.

Usage Example

# This example shows using two TSL2491 light sensors attached to TCA9548A channels 0 and 1.
# Use with other I2C sensors would be similar.
from machine import Pin, I2C
import tca9548a
from ssd1306 import SSD1306_I2C

# Create I2C bus as normal
i2c = I2C(Pin(25), Pin(26))

# Create the TCA9548A object and give it the I2C bus
tca = TCA9548A(i2c)

# For each sensor, create it using the TCA9548A channel instead of the I2C object
oled1 = SSD1306_I2C(tca[0])
oled2 = SSD1306_I2C(tca[1])

oled1.text("HELLO", 0, 0)
oled2.text("WORLD", 0, 0)

oled1.show()
oled2.show()

About

CircuitPython driver for the TCA9548A I2C Multiplexer.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%