''

Dependencies:   BME280 BMP280 TextLCD mbed

Fork of CW_watchdog_08012018a by Calvin Kalintra

Revision:
5:8aa72ee456fc
Parent:
2:c696dfd53eeb
diff -r 5dbb5145d0a9 -r 8aa72ee456fc putty.h
--- a/putty.h	Tue Jan 09 12:11:46 2018 +0000
+++ b/putty.h	Tue Jan 09 15:45:56 2018 +0000
@@ -3,7 +3,7 @@
 Serial pc(USBTX, USBRX); 
 char user_command[40] = {0};
 char user_command2[40] = {0};
-int n, datan = 0, datac = 0, counterd = 0, dates, times, interrupt = 0, gather_data = 1;
+int n, datan = 0, datac = 0, counterd = 0, dates, times, interrupt = 0, gather_data = 1, putty_enabled = 1;
 float t;
 
 
@@ -22,7 +22,7 @@
     pc.printf("printting %i datas\n\r", datac);
     while (counterd < datac)  
         { 
-            pc.printf("%i%i:%i%i:%i%i, %i%i/%i%i/%i%i%i%i, light: %2.4f, temp: %3.4f, press: %3.4f\n\r", date0_a[datan-1] ,date_a[datan-1], time0_a[datan-1], time_a[datan-1],data_light[datan-1], data_temp [datan-1], data_press[datan-1]);  
+            pc.printf("%i%i, %i%i, light: %2.4f, temp: %3.4f, press: %3.4f\n\r", date0_a[datan-1] ,date_a[datan-1], time0_a[datan-1], time_a[datan-1],data_light[datan-1], data_temp [datan-1], data_press[datan-1]);  
             if (datan == 0)
                 {
                     datan = 119;
@@ -47,7 +47,7 @@
         {
             while (counterd < n)  
                 { 
-                    pc.printf("%i%i:%i%i:%i%i, %i%i/%i%i/%i%i%i%i,, light: %2.4f, temp: %3.4f, press: %3.4f\n\r", date0_a[datan-1] ,date_a[datan-1], time0_a[datan-1], time_a[datan-1], data_light[datan], data_temp [datan], data_press[datan]);  
+                    pc.printf("%i%i, %i%i, light: %2.4f, temp: %3.4f, press: %3.4f\n\r", date0_a[datan-1] ,date_a[datan-1], time0_a[datan-1], time_a[datan-1], data_light[datan-1], data_temp [datan-1], data_press[datan-1]);  
                     if (datan == 0)
                         {
                             datan = 121;
@@ -239,7 +239,7 @@
             pc.printf("out of range\n\r");
         }
     }
-     else if (user_command[0] == 'S'&& user_command[1] == 'T'&& user_command[2] == 'A'&& user_command[3] == 'T'&& user_command[4] == 'E')
+    else if (user_command[0] == 'S'&& user_command[1] == 'T'&& user_command[2] == 'A'&& user_command[3] == 'T'&& user_command[4] == 'E')
     {
         if (user_command2[0] == 'O'&& user_command2[1] == 'N')
         {
@@ -252,6 +252,19 @@
             pc.printf("data is off\n\r");
         }
     }
+    else if (user_command[0] == 'L'&& user_command[1] == 'O'&& user_command[2] == 'G'&& user_command[3] == 'G'&& user_command[4] == 'I'&& user_command[5] == 'N'&& user_command[6] == 'G')
+    {
+        if (user_command2[0] == 'O'&& user_command2[1] == 'N')
+        {
+            putty_enabled = 1;
+            pc.printf("logging on\n\r");
+        }
+        else if (user_command2[0] == 'O'&& user_command2[1] == 'F'&& user_command2[2] == 'F')
+        {
+            putty_enabled = 0;
+            pc.printf("logging off\n\r");
+        }
+    }
 }
 //int main()
 //{