mbed publishes real time up-to-date FTSE100 index data and posts it to a 7 segment multipurpose mbed breakout board

Dependencies:   EthernetNetIf dispBoB mbed

Files at this revision

API Documentation at this revision

Comitter:
d_worrall
Date:
Wed Jul 06 10:20:18 2011 +0000
Child:
1:10d951807d06
Commit message:
version1

Changed in this revision

EthernetNetIf.lib Show annotated file Show diff for this revision Revisions of this file
FTSE100.cpp Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show annotated file Show diff for this revision Revisions of this file
PCA9635.lib Show annotated file Show diff for this revision Revisions of this file
dispBoB.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Wed Jul 06 10:20:18 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FTSE100.cpp	Wed Jul 06 10:20:18 2011 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+#include "dispBoB.h"
+
+EthernetNetIf eth; 
+HTTPClient http;
+Serial pc(USBTX, USBRX);
+dispBoB db(p28, p27, p26);
+  
+int main() {
+
+    printf("Start\n\r");
+    printf("\r\nSetting up...\r\n");
+    
+    EthernetErr ethErr = eth.setup();                                           //Setup ethernet connection
+    if(ethErr) { 
+        printf("Error %d in setup.\n\r", ethErr);
+        return -1;
+    }
+    printf("\r\nSetup OK\r\n");
+    
+    db.cls();
+    
+    HTTPText txt;                                                            //instantiate HTTPStream object
+    while(1){
+        HTTPResult r = http.get("http://www.mbed.webatu.com/dispBoBApp.php", &txt);   //load page into buffer
+        if(r==HTTP_OK){
+            string str = txt.gets();                                            //fetch string and store in str
+             
+            size_t length;                                                      //make some variables
+            char buffer[20];
+             
+            size_t found=str.find("<");                                    //tell me where < first appears
+            if(found!=string::npos){   
+                length=str.copy(buffer,int(found),0);
+                buffer[length]='\0';
+                string dispString = buffer;
+                db.scroll("FTSE100", 0.2);
+                db.locate(0);
+                db.printf("%s", dispString);    
+            }   
+        } else {
+            pc.printf("Error\n\r");
+        }
+        wait(2);
+    }
+}
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Wed Jul 06 10:20:18 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d0be6af2d1db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCA9635.lib	Wed Jul 06 10:20:18 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/d_worrall/code/PCA9635/#16f968749855
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dispBoB.lib	Wed Jul 06 10:20:18 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/d_worrall/code/dispBoB/#10570d97f4d3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 06 10:20:18 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912