I have a TM4C123GXL LaunchPad with an attached BOOSTXL-SENSHUB sensor hub. I am currently modifying the compdcm_mpu9150 example code. I have the most recent version of CCS.
My problem is the following: I am trying to output the data from the sensor hub to a file. I have (mostly) successfully done this with the humidity_sht21 example code, but for some reason the modified compdcm_mpu9150 code just runs through the main while loop once, then stops.
For the humidity code, I had to sufficiently increase the heap and stack size before it would function. I did the same thing here, and then further increased it in hopes that it would resolve the issue. It hasn't.
At this point, I really don't know what else I could try to get this code to function through more than one iteration of the loop.
The code changes are as follows:
- insert: #include <stdio.h>, #include <time.h> on lines 25 and 26
- starting on line 517, insert: time_t t = time(NULL);
struct tm tm = *localtime(&t);
char concat[50];
snprintf(concat,10,"%d",tm.tm_year-100); //-100 so that it's from 2000, not 1900
char added[50];
snprintf(added,10,"%03d",tm.tm_yday+1); //+1 so it's 1-366
strcat (concat, added); //should make it 001-366
snprintf(added,10,"%02d",tm.tm_hour); //ditto for these; 00-60
strcat (concat, added);
snprintf(added,10,"%02d",tm.tm_min);
strcat (concat, added);
snprintf(added,10,"%02d",tm.tm_sec);
strcat (concat, added);
strcat (concat, ".txt"); //Will use concat in fopen command
- near the bottom of the file, before the UARTprintf statements, insert: FILE * fid; fid = fopen(concat, a)
- finally, after each UARTprintf statement, insert: fprintf(fid, "%d.%03d\t%d.%03d\t%d.%03d\t\t", i32IPart[0], i32FPart[0], i32IPart[1], i32FPart[1], i32IPart[2], i32FPart[2]); //where each part[i] is changed appropriately
I understand I've indicated my changes to the code in a fairly muddled way. If it would be better to copy-paste the whole 736 lines of code, let me know.
Thank you in advance.