User Tools

Site Tools


google_calendar_and_mbed_controller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
google_calendar_and_mbed_controller [2012/06/17 11:04] tomgeegoogle_calendar_and_mbed_controller [2012/06/17 11:05] (current) tomgee
Line 2: Line 2:
  
  
-mBed - Google API source code+===== mBed - Google API source code =====
 A few people have asked me to post the source code. Here it is. Even though I have been programming for years in various database and IBM mainframe languages, I've never done much C, so feel free to send me a few tips. I'm not sure why, for example, it works only when ctTime and buffer[21] are declared outside of the subroutine they're used in?? A few people have asked me to post the source code. Here it is. Even though I have been programming for years in various database and IBM mainframe languages, I've never done much C, so feel free to send me a few tips. I'm not sure why, for example, it works only when ctTime and buffer[21] are declared outside of the subroutine they're used in??
  
Line 51: Line 51:
     //printf("url   %s\n",url);     //printf("url   %s\n",url);
     return url;     return url;
-}+    }
  
-string getPage(char url[256]) {+    string getPage(char url[256]) {
     printf("\nQuery Google API... \n");     printf("\nQuery Google API... \n");
     HTTPText txt("text/html",5000);     HTTPText txt("text/html",5000);
Line 67: Line 67:
        return "FAIL";        return "FAIL";
     }     }
-}+    }
  
-void getAPI() {+    void getAPI() {
     string testres;     string testres;
     string results;     string results;
Line 97: Line 97:
        }        }
     }     }
-}+   }
  
-void getNTP() {+   void getNTP() {
     ctTime = time(NULL);     ctTime = time(NULL);
     printf("Current time is (UTC): %d %s\n", ctTime, ctime(&ctTime));     printf("Current time is (UTC): %d %s\n", ctTime, ctime(&ctTime));
Line 107: Line 107:
     ctTime = time(NULL);     ctTime = time(NULL);
     printf("Time is now (UTC): %d %s\n", ctTime, ctime(&ctTime));     printf("Time is now (UTC): %d %s\n", ctTime, ctime(&ctTime));
-}+   }
  
-void checkTemperature() {+   void checkTemperature() {
     float temp = device.readTemperature();     float temp = device.readTemperature();
     if (temp > (targetTemp+0.5)) {     if (temp > (targetTemp+0.5)) {
Line 119: Line 119:
        led4 = 1;        led4 = 1;
     }     }
-}+   }
  
-int main() {+   int main() {
     EthernetErr ethErr;     EthernetErr ethErr;
     int count = 0;     int count = 0;
Line 171: Line 171:
         }         }
     }     }
-}+   }
google_calendar_and_mbed_controller.1339945456.txt.gz · Last modified: 2012/06/17 11:04 by tomgee