[teensy41] i2c problems
Posted: Sat Mar 05, 2022 1:40 am
I am now having trouble getting started with i2c on the teensy 4.1. Based on this:
https://github.com/robert-hh/micropytho ... ickref.rst
I believe i2c hardware port 0 refers to pins 18 (sda) and 19 (scl). I have those pins along with ground and 3.3V connected to a level shifter with an Arduino Uno on the other side (GND, 5V, A4 (sda) and A5 (scl) on the Uno side). I have used this same setup with i2c and a pyboard and everything worked fine.
I am trying to run this simple upython code:
>>> from machine import I2C
>>> i2c = I2C(0, 400_000)
>>> i2c.scan()
[]
>>> i2c.writeto(0x04, b'12')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
Since the scan returns nothing, it is not surprising that the writeto fails. As long as I have the pins right, I don't know what could be going wrong.
Any help appreciated.
Thanks,
Ryan
https://github.com/robert-hh/micropytho ... ickref.rst
I believe i2c hardware port 0 refers to pins 18 (sda) and 19 (scl). I have those pins along with ground and 3.3V connected to a level shifter with an Arduino Uno on the other side (GND, 5V, A4 (sda) and A5 (scl) on the Uno side). I have used this same setup with i2c and a pyboard and everything worked fine.
I am trying to run this simple upython code:
>>> from machine import I2C
>>> i2c = I2C(0, 400_000)
>>> i2c.scan()
[]
>>> i2c.writeto(0x04, b'12')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
Since the scan returns nothing, it is not surprising that the writeto fails. As long as I have the pins right, I don't know what could be going wrong.
Any help appreciated.
Thanks,
Ryan