Hi, I'm a beginner. Now I want an Arduino(Master) to hand float over another Arduino(Slave) using I2C. For some reason, I can't make it. Please tell me any source to archive this.
For your information my Sketches are like this but it's crap
(The basic idea is to split float into 4byte and send them all. Then slave get them together.)
AGAIN, you not necessarily need to fix my code. I just want any code to archive this: An Arduino(Master) to hand float over another Arduino(Slave)
I spotted the error already. As a beginner you should not be using multiple Arduino in any project. It is almost never a good solution. Only an expert will know when it's a good solution, and it is not very often.
Please explain why you think it is a good idea to use 2 Arduino.
This is your next problem (After requesting 4 bytes)
When you're sure the 4 bytes are in the correct order, you can use something like memcpy(&test, data, 4);
c/c++ provides a union to interpret the same memory area in different ways,
although officially undefined behaviour, this works as well on all Arduino hardware.