![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Proof of concept for distance and temperature monitoring
Dependencies: mbed mbedConnectorInterface mbedEndpointNetwork
Diff: main.cpp
- Revision:
- 6:bbea44df21e8
- Parent:
- 4:1ca75e77ae33
- Child:
- 7:939fdc8df95b
--- a/main.cpp Sat May 02 01:37:36 2015 +0000 +++ b/main.cpp Tue May 05 05:18:03 2015 +0000 @@ -5,7 +5,9 @@ #include "hcsr04.h" #include "GroveTemp.h" + #include "OnBoardLED.h" +#include "TemperatureResource.h" #include "StaticResource.h" @@ -26,8 +28,8 @@ /* DistanceResource distR(&logger, "3302/0/5600", distS); -TemperatureResource tempR(&logger, "3303/0/5700", tempS); */ +TemperatureResource tempR(&logger, "3303/0/5700", &tempS, true); LEDResource led(&logger, "3311/1/5706"); /* invoked through linker magic via Endpoint::start() */ @@ -35,10 +37,11 @@ { /* NSP configuration is in nsp_configuration.h */ logger.log("configure_endpoint: building endpoint configuration..."); + tempR.setMaxAge(0); return config.addResource(&mfg) .addResource(&model) /* .addResource(&distR) */ - /* .addResource(&tempR) */ + .addResource(&tempR) .addResource(&led) .build(); }