Ethernet communication for biomedical purposes

Dependencies:   C12832_lcd EthernetNetIf HTTPClient_ToBeRemoved mbed

Fork of TwitterExample by Donatien Garnier

TwitterExample.cpp

Committer:
TomDS
Date:
2013-11-25
Revision:
4:9aff8f7be9b8
Parent:
2:2a9775a81062
Child:
5:e68d9f6a8866

File content as of revision 4:9aff8f7be9b8:

#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPClient.h"
#include "C12832_lcd.h"
 
EthernetNetIf eth; 
HTTPClient http;
C12832_LCD lcd;
  
int main() {
 
  lcd.printf("Start\n");
  wait(1);
  lcd.printf("\r\nSetting up...\r\n");
  EthernetErr ethErr = eth.setup();
  if(ethErr)
  {
    lcd.printf("Error %d in setup.\n", ethErr);
    return -1;
  }
  lcd.printf("\r\nSetup OK\r\n");
  
  HTTPText txt;
  
  HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt);
  if(r==HTTP_OK)
  {
    lcd.printf("Result :\"%s\"\n", txt.gets()); 
  }
  else
  {
    lcd.printf("Error %d\n", r);
  }
  
  while(1)
  {
  
  }
  
  return 0;
  
}