display your latest tweet with WiFly RN-XV and AD128160-UART

Dependencies:   AD128160_kazushi_branch HTTPClient mbed PowerControl WiflyInterface

Fork of FontTest3 by Sim mbed

/media/uploads/kazushi2008/_scaled_twittermbed_scene.jpg /media/uploads/kazushi2008/_scaled_twittermbed.jpg

Please see at http://kazushi-lab.c.fun.ac.jp/pukiwiki/index.php?TwitterMbed

Files at this revision

API Documentation at this revision

Comitter:
kazushi2008
Date:
Wed Jan 09 05:40:55 2013 +0000
Parent:
2:56a2ab00e743
Child:
4:d7a5f6fe7987
Commit message:
stable with AD128160

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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);
-    }
+   }
 }