36
Cairsens - UART Version
return
num;
}
void DecodeBloc(unsigned char
{
float
f;
int
i;
f = ToFloat( data, 0);
f = ToFloat( data, 4);
i = ToInt16( data, 8);
i = data[10];
i = ToUInt16(data, 11);
i = data[13];
i = data[14];
i = data[15];
i = ToUInt16(data, 16);
i = ToUInt16(data, 18);
i = ToUInt16(data, 20);
}
void read_stored_data(void
{
int
i,nb;
unsigned char
int
pos;
rs_write(port, GetTrame(Trame10M, Reference), sizeof(Trame10M));
nb = readFrame(port , data , 2);
if
(nb <= 20)
{
printf(" \nno valid answer to read stored
return;
}
i = CalculCrc( data , 2 , data[2] + data[3]*256 );
if( i != 0 )
{
}
if
( 0x0D != data[19] )
{
}
i = 20;
pos = 1;
* data)
printf("PM 2.5 =
printf("PM 10 =
printf("Temp (1/10 °C) =
printf("Humidity 0-100% =
printf("Pressure =
printf("Battery charge 0-100% =
printf("3W Solar charge 0-100% =
printf("13W Solar charge
printf("ANA1 =
printf("ANA2 =
printf("ANA3 =
* port,
unsigned char
data[1024];
printf (
"\nBad CRC\n"
return;
printf (
"\nBad RSP\n"
return;
%g\n", f);
%g\n", f);
%d\n", i);
%d\n", i);
%d\n", i);
0-100% =
%d\n", i);
%d\n", i);
%d\n", i);
*Reference)
values\n");
);
);
%d\n", i);
%d\n", i);
%d\n", i);
© 2016 Cairpol