You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
811 B

void data()
{
//char test_data[] = "test3,3v";
//char test_data[] = "t133v+103c299h95s";
// vc-напряжение на батарее - целая часть
// vd-напряжение на батарее - дробная часть
//u=vc*10+vd
int u=vc*100+vd;
//tc=25 температура ds1802- целая часть
//td=3 температура ds1802- дробная часть
int t=tc*10+td;
//zn; знак 0+ 1- температура ds1802
int h=hc*10+hd;
//hc=75;влажность dh22- целая часть
//hd=6;влажность dh22- дробная часть
//s=56; освещенность
if (zn==0)
sprintf (test_data, "t5-%.3dc%.3dv%.3dh%.2ds",t,u,h,s);//"t1+103c33v299h95s";
else
sprintf (test_data, "t5+%.3dc%.3dv%.3dh%.2ds",t,u,h,s);//"t1+103c33v299h95s";*/
}