Proof of concept for distance and temperature monitoring
Dependencies: mbed mbedConnectorInterface mbedEndpointNetwork
Diff: main.cpp
- Revision:
- 10:338191178cbf
- Parent:
- 9:16b63cd4aba8
diff -r 16b63cd4aba8 -r 338191178cbf main.cpp --- a/main.cpp Thu May 07 04:14:57 2015 +0000 +++ b/main.cpp Mon May 18 00:44:59 2015 +0000 @@ -7,9 +7,10 @@ #include "GroveTemp.h" #include "StaticResource.h" -#include "OnBoardLED.h" +//#include "OnBoardLED.h" #include "TemperatureResource.h" #include "DistanceResource.h" +#include "MaxDistanceResource.h" /* Terminal connection */ RawSerial term(USBTX, USBRX); @@ -28,9 +29,14 @@ StaticResource latitude(&logger, "6/0/0", "35.296"); StaticResource longitude(&logger, "6/0/1", "-120.677"); -DistanceResource distR(&logger, "3302/0/5600", &distS, true); +DistanceResource distR(&logger, "3302/0/5700", &distS, true); +MaxDistanceResource maxDistR(&logger, "3302/0/5602", &distS, true); +StaticResource unitsDistR(&logger, "3302/0/5701", "cm"); + TemperatureResource tempR(&logger, "3303/0/5700", &tempS, true); -LEDResource led(&logger, "3311/1/5706"); +StaticResource unitsTempR(&logger, "3302/0/5701", "Cel"); + +//LEDResource led(&logger, "3311/1/5706"); /* invoked through linker magic via Endpoint::start() */ Connector::Options *configure_endpoint(Connector::OptionsBuilder &config) @@ -44,8 +50,11 @@ .addResource(&latitude) .addResource(&longitude) .addResource(&distR) + .addResource(&maxDistR) + .addResource(&unitsDistR) .addResource(&tempR) - .addResource(&led) + .addResource(&unitsTempR) + //.addResource(&led) .build(); }