-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTS221 support #276
Comments
The following may be helpful. https://github.com/arduino-libraries/Arduino_HTS221 |
Tried to look into it. I tried to raise a response with the "who am I" register but... the code would simply hang on any I2C operations. func main() {
const HTS221_ADDRESS = 0x5F
const HTS221_WHO_AM_I_REG = 0x0F
i2c := machine.I2C1
i2c.Configure(machine.I2CConfig{
SCL: machine.P0_15, // SCL1
SDA: machine.P0_14, // SDA1
})
data := []byte{0}
err := i2c.ReadRegister(HTS221_ADDRESS, HTS221_WHO_AM_I_REG, data)
println(data[0], err)
} If I set to other pins or set nothing I would get an "I2C bus error". I couldn't get "who am I" response from LSM9DS1 either (also stuck). I can ping all onboard devices with the Arduino I2C scanner script. Is there any way to check if the SCL1/SDA1 pins are working properly in TinyGo? |
@alankrantas
Either of the following will work // It works (I2C0)
machine.I2C0.Configure(machine.I2CConfig{
Frequency: machine.TWI_FREQ_400KHZ,
SDA: machine.P0_14,
SCL: machine.P0_15,
}) // It works (I2C1)
machine.I2C1.Configure(machine.I2CConfig{
Frequency: machine.TWI_FREQ_400KHZ,
SDA: machine.P0_14,
SCL: machine.P0_15,
}) |
NewI2C(). I forgot to change the part that passes to ssd1306. |
@alankrantas |
@sago35 Thanks! I got responses from both HTS221 and LSM9DS1. It turns out I have to set both |
We need support for the HTS221 capacitive digital sensor for relative humidity and temperature.
It is one of the sensors onboard the Arduino Nano 33 BLE Sense.
The text was updated successfully, but these errors were encountered: