Hello, I am working on a project where I send 5 different data (which are changing cca every 10ms) from one Arduino to another, using I2C communication. So the goal is that Serial Monitors of both Arduinos show all the same data every time the communication is successful. I want to count how many times the communication failed i.e. how many times the first Arduino didn't manage to send at least 1 out of the 5 most recent data. Any ideas or premade similar solutions are welcome
Find the reason for the failure, most probably in your hardware.
How do you expect the Serial Monitor shows and you can distinguish 100 numbers per second? At which baudrate?
If the I2C communication failed, then something is wrong. The I2C bus between Master and Slave is not a fault-tolerant bus, it should work 100% all the time.
Which Arduino boards do you use and can you show the sketch of the Master and the Slave ?
From Master side, you send data in Intel-Hex format (every digit is sent in its ASCII Code + other features) ; where, the last byte (send as 2-byte ASCII codes for the 2-digit of the byte) is the simple checksum. The Slave receives the message, recalcuates the checksum and reports error when the reclaculated checksum does not agree with the recieved checksum. (Assuem that the hardware is healthy; but, the communication line could be noisy.)