esp-rs / std-training

Embedded Rust on Espressif training material.
https://esp-rs.github.io/std-training
Apache License 2.0
606 stars 78 forks source link

Fix "I2c(AckCheckFailed)" error #250

Open zrll12 opened 6 months ago

zrll12 commented 6 months ago

It occurs when the time for it to measure is not enough

zrll12 commented 6 months ago

Do you mind elaborating on your changes? Why do you call get_measurement_result before start_measurement?

Any hint of why you were getting the I2c(AckCheckFailed) Err?

I am getting this error when the time is not enough for it to measure, and it exist a couple of times in the loop.

For the reason I don't call start_measurement before, it is just because I forgot to call it when I rewrite this code, and it is now added.

On my local test, it start_measurement is called outside the loop when I init it, but error still occurs.