![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
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
Revision 5:ce9188b5e787, committed 2011-07-07
- Comitter:
- d_worrall
- Date:
- Thu Jul 07 14:59:46 2011 +0000
- Parent:
- 4:eaed26093c4c
- Commit message:
- version4
Changed in this revision
FTSE100.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r eaed26093c4c -r ce9188b5e787 FTSE100.cpp --- a/FTSE100.cpp Thu Jul 07 14:57:38 2011 +0000 +++ b/FTSE100.cpp Thu Jul 07 14:59:46 2011 +0000 @@ -20,17 +20,17 @@ while(1){ HTTPResult r = http.get("http://mbed.net16.net/v1/dispBoBApp.php", &txt); //load page into buffer if(r==HTTP_OK){ - string str = txt.gets(); //load web page intop string + string str = txt.gets(); //load web page into string - char buf[10]; //instantiate buffer and integer to store FTSE100 + char buf[10]; //instantiate buffer and string to store FTSE100 string value; str.copy(buf,9,0); //load buffer with chunk of web page - sscanf(buf, "%s", value); //scan until decimal point + sscanf(buf, "%s", value); //scan until decimal point db.scroll("FTSE100", 0.2); //print info to dispBoB db.locate(0); - printf("%s\n\r", value); + db.printf("%s", value); } wait(2); //wait 2 seconds before looping, so we don't pester the servers too much }