array 'data_value[1]' & array 'data_value[2]' have the temperature and Humidity value.
Does it mean:
1. The following array elements contain Temperature Data
data_value[1][0]
data_value[1][1]
-------------------
data_value[1][9] //you have 10x10 character array;
Each array element contains 1-byte ASCII code for a HEX-digit; now, you combine two elements to get 1-byte HEX number. You have 10 elements (array members); after processing, you will get 5-byte data for the Temperature value. How to interpret this 40-bit data to find Temperature value in decimal format, that you know.
2. The following array elements contain Humidity Data
data_value[2][0]
data_value[2][1]
-------------------
data_value[2][9] //you have 10x10 character array;
Serial.println(data_value[1]);// this the array value for Temp; How i convert this value?
Do you know the meaning of the above instruction - what will it print? It is going to print the contents of the following array elements one after another.
data_valuw[1][0], ...., data_value[1][9] //Temperature value in character format
data_value[2][0], ...., data_value[2][9] //Humidity value in character format
...
data_value[9][0], ...., data_value[9][9] //----
Now, create your array manually:
char data_value[10][10] = {
{'x', 'x', ................, 'x'}, //data_value[0][0], ............, data_value[0][9]
{'x', 'x', ................, 'x'}, //data_value[1][0],............., data_value[1][9] //Tempertaure
{'x', 'x', ................, 'x'}, //data_value[2][0],............., data_value[2][9] //Humidity
.................................. .......................................................................................
{'x', 'x', ................, 'x'} //data_value[9][0],............., data_value[9][9]
};
Assume that:
data_value[1][0] = 0x31 //1 assume lower digit of the HEX byte
data_value[1][1] = 0x45 //E assume upper digit of the HEX byte
How to extract E1 from the above two elements?
byte x = data_value[1][0]; // x = 0x31 = 30 + 01
if (x < 0x41)
{
x = x - 0x30; // x = 0x31 - 0x30 = 0x01 = 00000001
}
else
{
x = x - 0x37 //
}
byte y = data_value[1][1]; // y = 0x45
if (y < 0x41)
{
y = y - 0x30; //
y = y << 4; //
}
else
{
y = y - 0x37; //0x45 - 0x37 = 0x0E = 00001110
y = y << 4; //y = 11100000
}
x = x|y; //x = 00000001 | 11100000 = 11100001 = E1
Now, you can use for() looping construct to reduce the number of instructions.