![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Used to determine the thermal wake left behind a weather ballon on its accent towards the edge of space.
Dependencies: DS1820 ExtendedTimer SDFileSystem mbed
Diff: main.cpp
- Revision:
- 1:abe448f0aae0
- Parent:
- 0:2e66ec9086f9
- Child:
- 2:1136b2fda54b
--- a/main.cpp Tue Apr 17 22:07:20 2018 +0000 +++ b/main.cpp Tue Apr 17 22:14:21 2018 +0000 @@ -17,7 +17,9 @@ -DS1820* probe[MAX_PROBES]; +DS1820* probe1[MAX_PROBES]; +DS1820* probe2[MAX_PROBES]; +DS1820* probeTail[MAX_PROBES]; Serial pc(USBTX, USBRX); SDFileSystem fs(p5, p6, p7, p8, "fs"); Timer t; @@ -66,7 +68,7 @@ int num_arm1 = 0; while(DS1820::unassignedProbe(ARM1_DATA_PIN)) { - probe[num_arm1] = new DS1820(ARM1_DATA_PIN); + probe1[num_arm1] = new DS1820(ARM1_DATA_PIN); num_arm1++; if(num_arm1 == MAX_PROBES) { @@ -80,7 +82,7 @@ int num_arm2 = 0; while(DS1820::unassignedProbe(ARM2_DATA_PIN)) { - probe[num_arm2] = new DS1820(ARM2_DATA_PIN); + probe2[num_arm2] = new DS1820(ARM2_DATA_PIN); num_arm2++; if(num_arm2 == MAX_PROBES) { @@ -94,7 +96,7 @@ int num_tail = 0; while(DS1820::unassignedProbe(TAIL_DATA_PIN)) { - probe[num_tail] = new DS1820(TAIL_DATA_PIN); + probeTail[num_tail] = new DS1820(TAIL_DATA_PIN); num_tail++; if(num_tail == MAX_PROBES) { @@ -105,21 +107,21 @@ for(int i = 0; i < num_arm1; i++) { - fullName = probe[i]->whoAmI(); + fullName = probe1[i]->whoAmI(); //print 64-bit ID as a hexadecimal number fprintf(out1,"%llX\t", fullName); } for(int i = 0; i < num_arm2; i++) { - fullName = probe[i]->whoAmI(); + fullName = probe2[i]->whoAmI(); //print 64-bit ID as a hexadecimal number fprintf(out2,"%llX\t", fullName); } for(int i = 0; i < num_tail; i++) { - fullName = probe[i]->whoAmI(); + fullName = probeTail[i]->whoAmI(); //print 64-bit ID as a hexadecimal number fprintf(out3,"%llX\t", fullName); } @@ -148,14 +150,16 @@ if(timeToRead == true) { timeToRead = false; //reset data collection flag - probe[0]-> convertTemperature(true, DS1820::all_devices); + probe1[0]-> convertTemperature(true, DS1820::all_devices); + probe2[0]-> convertTemperature(true, DS1820::all_devices); + probeTail[0]-> convertTemperature(true, DS1820::all_devices); //print from arm 1 fprintf(out1, "%3.1f\t", t.read()); //Get temp from each device for(int i = 0; i < num_arm1; i++) { - fprintf(out1, "%3.1f\t", probe[i]->temperature()); + fprintf(out1, "%3.1f\t", probe1[i]->temperature()); } fprintf(out1,"\r\n"); @@ -164,7 +168,7 @@ //Get temp from each device for(int i = 0; i < num_arm2 ; i++) { - fprintf(out2, "%3.1f\t", probe[i]->temperature()); + fprintf(out2, "%3.1f\t", probe2[i]->temperature()); } fprintf(out2,"\r\n"); @@ -173,7 +177,7 @@ //Get temp from each device for(int i = 0; i < num_tail; i++) { - fprintf(out3, "%3.1f\t", probe[i]->temperature()); + fprintf(out3, "%3.1f\t", probeTail[i]->temperature()); } fprintf(out3,"\r\n");