Ion Systems / Mbed 2 deprecated Chipin_Main

Dependencies:   MCP23017 TCS3472_I2C WattBob_TextLCD mbed-rtos mbed

Revision:
12:814a8fdbb6f7
Parent:
10:8c0696b99692
Child:
20:6de191ac7ff3
--- a/mbedStorage.h	Thu Nov 13 11:59:39 2014 +0000
+++ b/mbedStorage.h	Mon Nov 17 21:31:42 2014 +0000
@@ -1,12 +1,24 @@
 #include "mbed.h"
-bool logEnable = false;
+bool logEnable = true;
 LocalFileSystem local("local");
 void writeFile(int r, int g, int b){
+    
     FILE* file = fopen("/local/datafile.txt","w"); // open file
+    if(r >= 0){
     fputc(r, file); // put char (data value) into file
+    }else{
+        fputc(0, file);  
+    }if(g >00){
     fputc(g, file); // put char (data value) into file
+    }else{
+        fputc(0, file);   
+    }if(b >= 0){
     fputc(b, file); // put char (data value) into file
+    }else{
+        fputc(0, file);   
+    }
     fclose(file); // close file 
+    
 }
     
 int readFile(int index){
@@ -20,12 +32,12 @@
 }
 
 void log(char* text){
-    if(logEnable){
+    /*if(logEnable){
         FILE* file = fopen ("/local/log.txt", "a");    
         fputs(text, file);
         fputs("\r\n", file);
         fclose(file);
-        }
+        }*/
 }
 
 void clearLog(){