i2c addresses go only up to 127

This commit is contained in:
Sebastian Hugentobler 2024-05-22 08:51:18 +02:00
parent 790a27cc6d
commit 75544904a5

View File

@ -20,7 +20,7 @@ async fn main(_spawner: Spawner) {
let config = twim::Config::default();
let mut i2c = Twim::new(p.TWISPI0, Irqs, p.P0_03, p.P0_04, config);
for addr in 1..=u8::MAX {
for addr in 1..=127 {
if i2c.read(addr, &mut [0]).await.is_ok() {
info!("i2c device at 0x{:02X}", addr)
}