I already asked this on reddit because i coudn't post here two days ago but there noone could help me so maybe you can help me here.
I just got the MagTag with an AHT20 Sensor and an ST25DV16 that I want to use in my project. At first I wanted to find these two chips via I2C to check the connection but when I want to use I2C over StemmaQT I get the error message "RuntimeError: SDA or SCL needs a pull up". I connected the chips via the StemmaQT connector cables from adafruit and I didn't tested both at the same time.
When i only want to detect the LIS3DH accelerometer on the board without using the StemmaQT it works and i also tested the LIS3DH accelerometer with the simple example and it communicates fine.
I also checked the soldered 10k Pull Ups on the board and the connection to the sensors and they are fine too.
So why do I get that error?
This is the Code I used to detect the devices
- Code: Select all | TOGGLE FULL SIZE
# CircuitPython Demo - I2C sensor
import time
import board
i2c = board.I2C()
# Lock the I2C device before we try to scan
while not i2c.try_lock():
pass
# Print the addresses found once
print("I2C addresses found:", [hex(device_address)
for device_address in i2c.scan()])
# Unlock I2C now that we're done scanning.
i2c.unlock()
The Board library also uses the busio library according to the documentation. But I also tried to use the busio library directly and got the same error.
I used this code for busio:
- Code: Select all | TOGGLE FULL SIZE
import busio
from board import *
i2c = busio.I2C(SCL, SDA)
print(i2c.scan())
i2c.deinit()