Hi, when i try to replicate the example code for i2c sensor in i2c.rs i have a warning from the compiler:
unused import: Error
I can communicate with my sensor (an accelerometer), but when i try to generate an error, for example by detatching the sensor from the board, the code crashes an i'm unable to return an error. I'm using an stm32f401
Hi, when i try to replicate the example code for i2c sensor in i2c.rs i have a warning from the compiler: unused import:
Error
I can communicate with my sensor (an accelerometer), but when i try to generate an error, for example by detatching the sensor from the board, the code crashes an i'm unable to return an error. I'm using an stm32f401use embedded_hal::i2c::{I2c, Error};
const ADDR: u8 = 0x15; pub struct TemperatureSensorDriver {
i2c: I2C,
}
impl TemperatureSensorDriver {
pub fn new(i2c: I2C) -> Self {
Self { i2c }
}
}