![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
v1
Diff: main.cpp
- Revision:
- 1:69472741bd36
- Parent:
- 0:f4fb5a0f6981
- Child:
- 2:41238982b498
diff -r f4fb5a0f6981 -r 69472741bd36 main.cpp --- a/main.cpp Thu Jul 29 17:03:31 2021 +0000 +++ b/main.cpp Thu Jul 29 18:37:48 2021 +0000 @@ -21,6 +21,8 @@ // *************************************************** // 変数の宣言 // *************************************************** +char nich_status; + bool header_set = false; char im_buf[16];//16なのって意味ある? int im_buf_n = 0; @@ -41,8 +43,8 @@ // 0xA1 const char HEADER_DATA = 0xA2; -// 0xA2 -// +// 0xA2,lat,lon,height,press,temp,altitude +// 1 const char HEADER_ECHO = 0xA5; // 0xA5,コマンド @@ -142,40 +144,46 @@ } void ReadData(){ - pc.printf("***Acquired Data****\r\n"); + //pc.printf("***Acquired Data****\r\n"); + pc.printf("***Recieved Data****\r\n"); int bit = 1; + nich_status = im920.data[bit]; + bit += 1; + pc.printf("Nichrome Status : %c\r\n",nich_status); lat = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.7f\r\n",lat); + pc.printf("Latitude : %.7f\r\n",lat); lon = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.7f\r\n",lon); - altitude = (float)im920.toFloat(bit); + pc.printf("Longitude : %.7f\r\n",lon); + height = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.7f\r\n",height); + pc.printf("Height : %.7f\r\n",height); press = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.4f[hPa]\r\n", press); + pc.printf("Pressure : %.4f[hPa]\r\n", press); temp = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.2f[℃]\r\n", temp); + pc.printf("Temperarure : %.2f[℃]\r\n", temp); altitude = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.2f[m]\r\n", altitude); + pc.printf("Altitude : %.2f[m]\r\n", altitude); voltage_main = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.2f\r\n",voltage_main); + pc.printf("Voltage Main : %.2f\r\n",voltage_main); current_main = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.2f\r\n",current_main); + pc.printf("Crrent Main : %.2f\r\n",current_main); voltage_sep = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.2f\r\n",voltage_sep); + pc.printf("Voltage Sep : %.2f\r\n",voltage_sep); current_sep = (float)im920.toFloat(bit); bit += 4; - pc.printf("%.2f\r\n",current_sep); + pc.printf("Current Sep : %.2f\r\n",current_sep); + + for(int i = 0; i < 20; i++){ pc.printf("*");