Example ARM Mbed client for connecting to the thinger.io platform.

Dependencies:   ThingerEthernetClient mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "ThingerEthernetClient.h"
00003 
00004 DigitalOut redLed(LED1);
00005 
00006 void redLedCallback(pson& in){
00007     redLed = in ? 0 : 1;
00008 }
00009 
00010 int main() {
00011     ThingerEthernetClient thing("username", "device_id", "device_credential");
00012     
00013     thing["red_led"].set_input(redLedCallback);
00014     
00015     while(true){
00016         thing.handle();
00017     }
00018 }