Dependencies:   EthernetNetIf mbed ID12RFID

Files at this revision

API Documentation at this revision

Comitter:
ahurtado
Date:
Wed Sep 28 07:55:41 2011 +0000
Commit message:

Changed in this revision

EthernetNetIf.lib 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
ID12RFID.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp 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
diff -r 000000000000 -r 1aa4e7b774f0 EthernetNetIf.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Wed Sep 28 07:55:41 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
diff -r 000000000000 -r 1aa4e7b774f0 HTTPClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Wed Sep 28 07:55:41 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d0be6af2d1db
diff -r 000000000000 -r 1aa4e7b774f0 ID12RFID.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ID12RFID.lib	Wed Sep 28 07:55:41 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/ID12RFID/#f04afa911cf5
diff -r 000000000000 -r 1aa4e7b774f0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 28 07:55:41 2011 +0000
@@ -0,0 +1,54 @@
+// RFID Tweeter
+/*
+  Update: 21-06-2010
+  The basic authentication service for twitter is going down.
+  To continue using that program, the code has been updated to use http://supertweet.net which acts as an API proxy.
+  Simply visit the website to setup your twitter account for this API.
+  See: http://www.supertweet.net/about/documentation
+*/
+
+#include "mbed.h"
+//#include "ID12RFID.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+
+#define TWITTER_USER "cilabnerds"
+#define TWITTER_PASSWORD "********"
+
+#define IDS_COUNT 3
+//const int ids_list[IDS_COUNT] = {89481809, 89481810, 89481811};
+//const char* names_list[IDS_COUNT] = {"Donatien", "Simon", "Dan"};
+
+EthernetNetIf ethernet;
+HTTPClient twitter;
+
+//ID12RFID rfid(p14);
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+int main() {
+    led1 = 1;
+    if (ethernet.setup() == ETH_OK)
+        led2 = 1;
+    else{
+        led1 = 0;
+    }
+    wait(2);
+    
+    twitter.basicAuth(TWITTER_USER, TWITTER_PASSWORD);
+    led3 = 1;
+    
+    HTTPMap msg;
+    msg["status"] = "Alvaro esta twitteando desde una plaquita mbed NXP LPC1768. Experimentos desde \@cilabtwitt.";
+    HTTPResult r = twitter.post("http://api.supertweet.net/1/statuses/update.xml", msg, NULL);
+    
+    if(r == HTTP_OK)
+        led4 = 1;
+    else{
+        led1 = 0;
+        led2 = 0;
+        led3 = 0;
+   }
+}
diff -r 000000000000 -r 1aa4e7b774f0 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 28 07:55:41 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da