zcbvsDG
Revision 1:bd6575a12f84, committed 2017-09-26
- Comitter:
- deepak15
- Date:
- Tue Sep 26 06:54:02 2017 +0000
- Parent:
- 0:aa8df9825311
- Commit message:
- send data on interval of 60 sec ;
Changed in this revision
src/ota_example.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r aa8df9825311 -r bd6575a12f84 src/ota_example.cpp --- a/src/ota_example.cpp Mon Sep 25 09:41:00 2017 +0000 +++ b/src/ota_example.cpp Tue Sep 26 06:54:02 2017 +0000 @@ -171,7 +171,7 @@ //light = lux.read_u16(); uint16_t samples; pc.baud(115200); - pc.printf("Results:\n"); +// pc.printf("Results:\n"); // for(int i=0; i<1024; i++) { samples = input.read_u16(); // pc.printf(" %d\n", samples); @@ -183,25 +183,18 @@ pc.printf(" send when value is less than 50000=="); send_data(tx_data); pc.printf("====================================================="); - pc.printf("%d",light); + pc.printf("%d",light); } - time_t seconds_1=0; + time_t seconds = time(NULL); - if (((seconds - seconds_1)>(12))){ - - seconds_1 = seconds; - pc.printf("Seconds : %d\n", seconds - seconds_1); -// pc.printf("Seconds : %d\n", seconds); + if ((seconds%60)==0){ + pc.printf("Seconds : %d\n", seconds); + send_data(tx_data); } - //uint32_t time_1; -// time_1= t.read(); -// if(time_1>5){ -// pc.printf(" send after 10 sec ====================================================="); -// send_data(tx_data); -// } + - wait(1); + #endif // if going into deepsleep mode, save the session so we don't need to join again after waking up