Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem dspmodified mbed
Fork of fft_merge_main_codev1 by
Diff: main.cpp
- Revision:
- 5:87587eaeb702
- Parent:
- 3:ae644cac8e0b
- Child:
- 6:19f5d8f63010
--- a/main.cpp Sat Jan 24 12:43:17 2015 +0000 +++ b/main.cpp Sun Jan 25 09:02:18 2015 +0000 @@ -20,6 +20,7 @@ char filename[100] = ""; char filepath[100] = ""; char timestamp[100]=""; +char time_stamp[20]=""; char timestampold[100]=""; char main_dir[100] =""; char hour_dir[100] =""; @@ -101,6 +102,13 @@ //sprintf(response,timestamp); x=20; year = 10*(timestamp[x+1]-48) + (timestamp[x+2]-48); + month = (timestamp[x+4]-48)*10+(timestamp[x+5]-48); + date = (timestamp[x+7]-48)*10+(timestamp[x+8]-48); + hour = (timestamp[x+10]-48)*10+(timestamp[x+11]-48); + minute = (timestamp[x+13]-48)*10+(timestamp[x+14]-48); + second = (timestamp[x+16]-48)*10+(timestamp[x+17]-48); + + sprintf(time_stamp,"%02d%02d%02d%02d%02d%02d",year,month,date,hour,minute,second); while(year<15||year>20) { sendATcommand("AT+CCLK?\r", "OK", 5,0); @@ -114,11 +122,7 @@ { sprintf(timestampold,timestamp); //pc.printf("\r\nold time stamp is%s\r\n",timestampold); - month = (timestamp[x+4]-48)*10+(timestamp[x+5]-48); - date = (timestamp[x+7]-48)*10+(timestamp[x+8]-48); - hour = (timestamp[x+10]-48)*10+(timestamp[x+11]-48); - minute = (timestamp[x+13]-48)*10+(timestamp[x+14]-48); - second = (timestamp[x+16]-48)*10+(timestamp[x+17]-48); + sprintf(main_dir,"/sd/%s",sitename); sprintf(month_dir,"%s/%s%02d%02d",main_dir,sitename,year,month); @@ -443,9 +447,14 @@ //pc.printf("\r\n%s",timestamp); fclose(fp); } - - sampling(); - store(); + pc.printf("\r\n Timestamp saved"); + while(1) + { + + sampling(); + store(); + wait(34); + } //fft(16384,0,1,1); //prepare_fft_array(fft_start_index,fft_points_count,fft_maximas_required,fft_segments); } \ No newline at end of file