I2C on Pytrack2 pyport
-
Hi all,
I connected a I2C sensor to the pyport on pytrack2. Than my script is:
"from machine import I2C, Pin
i2c = I2C(0, pins=(SDA,SCL))
i2c.init(I2C.MASTER, baudrate=115000)
i2c.scan()"Anyone can help me about how can I refer to SDA and SCL on pyport? I don't find in any place which Pins I have to indicate.
thank you for any help.
-
Hi,
The pin numbers are P22 for SDA, and P21 for SCL
They are indicated (maybe in an obscure way) here: https://docs.pycom.io/datasheets/expansionboards/pysense2/ in the pinout -
@Gijs Hi thank you so much for your answer. I try to access I2C using P22 and P21 but I got "bus error". Do you have success using I2C on sensor port with these Pins?
-
@Gijs P21 and P22 seems for gps and accelerometer
-
@lolloz I2C is a shared bus with one master and potentially many slaves. If you use other devices on that bus, you need to re-use the same I2C device.
-
@jcaron thank you for your replay. my question is: have you ever tried to access a sensor connected to pyport on pytrack2 and you success on this? My fear is that thare is some issue on this port.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login