You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to run until it finds the sensor, and then it freezes.
the Write direction seems to run fine, but the read direction hangs.
I've tried adding some code below the i2cdetect but it doesn't appear as if any of it actually runs.
I've tried using the normal Arduino/C++ code provided by the manufacturer and it worked (connected and sent measurements over serial) so I don't think I've setup the hardware incorrectly, but please let me know if I fumbled something obvious.
I also tried just calling ping and it seemed to behave the same way (unsurprisingly..) where the ping goes through, but all following calls to i2c hang/panic(?)
let pinged = i2c
.ping_device(NDIR_ADDR, arduino_hal::i2c::Direction::Read).unwrap();
ufmt::uwriteln!(&mut serial,"Pinged: {}\r",if pinged {1} else {0}).unwrap();
ufmt::uwriteln!(&mut serial,"Read direction test:\r").unwrap_infallible();// this code doesn't run (except the first row of labels)
i2c.i2cdetect(&mut serial, arduino_hal::i2c::Direction::Read).unwrap_infallible();
The text was updated successfully, but these errors were encountered:
Keep the mvp a minimum viable product, meaning: Stay away from swapping the order of Read/Write and other let me change this now, I will need it later away
Check, double check and triple check the hardware setup. That implies having a schematic of the electronics. And above all: Understand all the hardware involved
Document your prototype further. Do it for your future self and do it for your current self that is seeking help from others.
Enjoy the challenge of getting to work what you envision
Persist
Smile humbly upon reaching your goal
Maybe publish the achievement (It is 2025, there is something called Internet, every one is a publisher.)
My advice to everyone seeking help with their project:
I'm using an Arduino Mega 2560 R3 with a MH-Z16 CO2 sensor in I2C mode
I basically just took the sample for I2Cdetect verbatim (just swapped the order of Read/Write)
It seems to run until it finds the sensor, and then it freezes.
the Write direction seems to run fine, but the read direction hangs.
I've tried adding some code below the i2cdetect but it doesn't appear as if any of it actually runs.
I've tried using the normal Arduino/C++ code provided by the manufacturer and it worked (connected and sent measurements over serial) so I don't think I've setup the hardware incorrectly, but please let me know if I fumbled something obvious.
I also tried just calling
ping
and it seemed to behave the same way (unsurprisingly..) where the ping goes through, but all following calls to i2c hang/panic(?)The text was updated successfully, but these errors were encountered: