display your latest tweet with WiFly RN-XV and AD128160-UART
Dependencies: AD128160_kazushi_branch HTTPClient mbed PowerControl WiflyInterface
Fork of FontTest3 by
Please see at http://kazushi-lab.c.fun.ac.jp/pukiwiki/index.php?TwitterMbed
Diff: main.cpp
- Revision:
- 3:cce58539833e
- Parent:
- 2:56a2ab00e743
- Child:
- 4:d7a5f6fe7987
--- a/main.cpp Mon Jan 07 04:15:48 2013 +0000 +++ b/main.cpp Wed Jan 09 05:40:55 2013 +0000 @@ -117,6 +117,8 @@ drawString((unsigned char*)localip); newline(); delete [] localip; + + return 0; } void onGsReceive (int cid, int len) { @@ -154,7 +156,7 @@ led2 = 0; - delete [] buf; + //delete [] buf; } int main() { @@ -184,19 +186,20 @@ host.setName(HTTP_HOST); - for (;;) { + while(1) { led1 = !led1; wait_ms(500); led1 = !led1; // blink - gs.poll(); r = gs.httpGet(host, HTTP_URI, HTTP_USER, HTTP_PASS, 0, &onGsReceive); + gs.poll(); if (!gs.isConnected(r)) { color(0x001f); cls(); msg = "reconnect"; drawString((unsigned char*)msg); newline(); + wait_ms(5); connect(); } wait(INTERVAL_SEC); - } + } }