RP2040 Feather and encoder_basic and STEMMA

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
5600chuck
 
Posts: 7
Joined: Tue Aug 23, 2022 10:58 am

RP2040 Feather and encoder_basic and STEMMA

Post by 5600chuck »

How do I tell the RP2040 that I'm using the STEMMA connector (Wire1) for the rotary encoder instead of Wire0.
I would like to drive all of my I2C devices (BMP390, SH1106, and rotary encoder) from the STEMMA connector.
When I run I2C_Scan they all show up on Wire1 while using the STEMMA connector (as they should).

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: RP2040 Feather and encoder_basic and STEMMA

Post by dastels »

Look at the code for use of Wire and replace it with Wire1. Often &Wire will be passed to a constructor, pass &Wire1 instead.

Dave

User avatar
5600chuck
 
Posts: 7
Joined: Tue Aug 23, 2022 10:58 am

Re: RP2040 Feather and encoder_basic and STEMMA

Post by 5600chuck »

Thanks Dave, for your rapid reply.
In the Arduino Sketch "encoder_basic" there was no instance of Wire.
But I edited Adafruit_seesaw.h by adding #define Wire Wire1 after #include <Wire.h> and that seemed to do the trick.
Thanks again

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: RP2040 Feather and encoder_basic and STEMMA

Post by dastels »

You should be able to pass &Wire1 in the seesaw constructor. It defaults to using &Wire.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”