Wire.onReceive (receiveEvent) // interrupt handler for incoming messages Here is my edited versions, however I am still not able to catch the "else" condition of the Slave being unreachable: In other words, an Arduino monitoring another Arduino. Catch a situation where the Master (Arduino Yun Shield) cannot communicate with the Slave ( Arduino r3 - with sensor) due to its power supply and/or sensor reading failing. I have edited the examples you gave to try and fit in with what I am trying to achieve. ![]() In response to Nick Gammons suggestions (below): Actually the data comes from a capacitive sensor, so would it be possible to just have both arduinos read from the same sensor? ![]() Both devices are Arduino Uno r3.Īny ideas I may not have tried yet? Any way to send a single value to the Master and update it every 30 secs would do. I can't seem to find a way for example, to simply check if a Wire() connection exists before requesting data and freezing everything. I didn't realise I2C was so problematic in this regard and I have been a number of weeks trying all types of alternative setups to try and avoid this situation. I am using I2C to successfully request critical data from a Slave device (I have to use requestFrom() in the Master) but if, for some reason, the power disconnects from the Slave device then the Master freezes altogether.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |