dougp:
Are you saying you have numbers that you want to convert to char and send that to the Particle and it will convert char back to floats and store them in an array?
drmesa:
dougp, Yes that's what I need to do. From there I can take the data from the array and send to the cloud as needed.
1. You have UNO Board and Photon Particle Board which are connected together via I2C Bus.
2. You have 8 numbers. I am assuming that they are float numbers which you have not explicitly mentioned i your post; but, it is understood. They are stored in an array.
3. You want to send these numbers from UNO to PP using I2C Bus.
4. These are the steps that could be taken:
(1) Declare your float numbers:
float myfloat[] = {1.23, 4.56, 7.89, 12.45, 624.75, 11.23, 74.12, 0.07};
(2) Send them to PP using I2C_Anything.h Library which converts each float number to its corresponding 32-bit (4-byte) number and sends to PP. (Edit:) reads the bytes of the float number from an unseen array and stores them in FIFO for onward transmission to destination.
void loop()
{
Wire.beginTransmission(0x08);
for (int i = 0; i < 8; i++)
{
I2C_writeAnything(myfloat[i]);
}
Wire.endTransmission();
delay(1000);
}
(3) At the Receiver/Slave side, collect the received bytes from FIFO and save into an array of float numbers:
void receiveEvent(int howMany) //howMany = nuber of bytes received
{
for (int i = 0; i < 8; i++)
{
I2C_readAnything(myfloat[i]);
}
flag1 = true;
}
(4) Screenshot of the Slave where we can see that the received numbers agree with the numbers sent by Master.

