Contains example code to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service via ethernet.

Dependencies:   C12832 MQTT LM75B MMA7660

Dependents:   MFT_IoT_demo_USB400 IBM_RFID

Revision:
4:77fd4b6ceecb
Parent:
3:69ef39823eef
Child:
5:11fd21af0c0f
--- a/main.cpp	Fri Jul 18 09:33:01 2014 +0000
+++ b/main.cpp	Tue Jul 22 09:19:54 2014 +0000
@@ -59,10 +59,9 @@
 //#define AUTHTOKEN "<auth-token>";
 
 C12832 lcd(D11, D13, D12, D7, D10);
-PwmOut r (D5);
-PwmOut g (D8);
-PwmOut b (D9);
-DigitalOut led2(LED2);
+BusOut r (D5);
+BusOut g (D9);
+BusOut led2 (LED_BLUE);
 MMA7660 MMA(PTE25, PTE24);
 LM75B sensor(PTE25, PTE24);
 DigitalIn Up(A2);
@@ -208,7 +207,10 @@
     //RGB: yellow
     r = 0;
     g = 0;
-    b = 1;
+    
+    #ifdef TARGET_K64F
+        led2 = 1;
+    #endif
     
     lcd.cls();
     lcd.set_font((unsigned char*) Arial12x12);
@@ -280,10 +282,14 @@
         }
         
         if (interval == 0) {
-            //led2 = 0;   
+            #ifdef TARGET_K64F
+                led2 = 1;
+            #else
+                led2 = 0;
+            #endif
         } else {
             if (i%(interval)==0) {
-                //led2 = !led2;
+                led2 = !led2;
             }
         }
         
@@ -300,7 +306,6 @@
     //RGB: yellow
     r = 0;
     g = 0;
-    b = 1;
     
     lcd.cls();
     lcd.locate(0,0);
@@ -372,7 +377,6 @@
         //RGB: green
         r = 1;
         g = 0;
-        b = 1;
         
         lcd.locate(0,0);        
         lcd.printf("IBM IoT Cloud");