google_calendar_and_mbed_controller
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
google_calendar_and_mbed_controller [2012/06/17 11:04] – tomgee | google_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' | 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' | ||
Line 51: | Line 51: | ||
// | // | ||
return url; | return url; | ||
- | } | + | |
- | string getPage(char url[256]) { | + | |
printf(" | printf(" | ||
HTTPText txt(" | HTTPText txt(" | ||
Line 67: | Line 67: | ||
| | ||
} | } | ||
- | } | + | |
- | 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(" | printf(" | ||
Line 107: | Line 107: | ||
ctTime = time(NULL); | ctTime = time(NULL); | ||
printf(" | printf(" | ||
- | } | + | } |
- | 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