Thinger.io Client Example for the WIZnet platform.
Dependencies: ThingerWIZnetClient mbed
Fork of ThingerWiznetClientExample by
main.cpp
- Committer:
- alvarolb
- Date:
- 2015-12-26
- Revision:
- 0:b756c85bcd9e
File content as of revision 0:b756c85bcd9e:
#include "mbed.h" #include "ThingerEthernetClient.h" DigitalOut redLed(LEDR); DigitalOut greenLed(LEDG); DigitalOut blueLed(LEDB); void redLedCallback(pson& in){ redLed = in ? false : true; } void greenLedCallback(pson& in){ greenLed = in ? false : true; } void blueLedCallback(pson& in){ blueLed = in ? false : true; } int main() { ThingerEthernetClient thing("username", "device_id", "device_credential"); thing["red_led"].set_input(redLedCallback); thing["green_led"].set_input(greenLedCallback); thing["blue_led"].set_input(blueLedCallback); while(true) { thing.handle(); } }