Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

QT PY I2C1
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

QT PY I2C1

by Jamesmaclean on Tue Jan 25, 2022 12:21 am

I connected my New, new New QT Py RP2040 to my new, new SHT 40 board with my new Stemma Connector only to find that Stemma is using I2C1 on QT Py. (Rats!!)
So I jumpered the SHT 40 to the I2C pins and it works great!!

So, how do I actually address the Stemma Connector when the imported board/module only has I2C (no board.I2C1) ??


i2c = board.I2C() # uses board.SCL and board.SDA
#i2c = board.I2C(board.SCL1, board.SDA1) # Display SCL & SDA ??

Thanks
James

Jamesmaclean
 
Posts: 7
Joined: Fri Oct 30, 2020 10:51 pm

Re: QT PY I2C1

by danhalbert on Tue Jan 25, 2022 12:52 am

Use this:
Code: Select all | TOGGLE FULL SIZE
import busio, board
i2c = busio.I2C(board.SCL1, board.SDA1)


We will soon be adding a `board.STEMMA_I2C()` for convenience, but the above works fine.

danhalbert
 
Posts: 3179
Joined: Tue Aug 08, 2017 12:37 pm

Re: QT PY I2C1

by Jamesmaclean on Tue Jan 25, 2022 11:32 am

Super !

Thanks for helping!!

Jamesmaclean
 
Posts: 7
Joined: Fri Oct 30, 2020 10:51 pm

Re: QT PY I2C1

by Jamesmaclean on Tue Jan 25, 2022 11:40 am

Super !

Thanks for helping!!

Also in CircuitPython why are the Pi Pico's RP2040 boards Pins labeled GP1, GP2 etc.
while the QT Py board's pins named have Labels like A0 A1 & SCL, SDA, D1, D2 ?

Seems like a 2nd learning curve rather than Board to Board consistency ?

Jamesmaclean
 
Posts: 7
Joined: Fri Oct 30, 2020 10:51 pm

Re: QT PY I2C1

by danhalbert on Tue Jan 25, 2022 12:09 pm

The CircuitPython pin names follow the printing on the boards. On Pi Pico, we go by the silkscreen on the bottom (we wish it were on top).

The Qt Py pins are consistent across all QT Py's, RP2040, SAMD21, ESP32-S2, etc. This allows running the same programs on multiple boards. So the consistency is across board types, not across chips. (There are some exceptions for ESP32-S2 boards, for complicated reasons).

danhalbert
 
Posts: 3179
Joined: Tue Aug 08, 2017 12:37 pm

Re: QT PY I2C1

by Jamesmaclean on Tue Jan 25, 2022 1:46 pm

Oh, I see.
Thanks for telling me!

Jamesmaclean
 
Posts: 7
Joined: Fri Oct 30, 2020 10:51 pm

Please be positive and constructive with your questions and comments.


cron