Orefatoi
/
afero_poc15_171201
POC1.5 prototype 2 x color sensor 2 x LM75B 3 x AnalogIn 1 x accel
Diff: edge_sensor/edge_accel.cpp
- Revision:
- 8:5590f55bdf41
- Parent:
- 0:f0de320e23ac
- Child:
- 9:f958fa2cdc74
--- a/edge_sensor/edge_accel.cpp Thu Dec 07 01:06:46 2017 +0000 +++ b/edge_sensor/edge_accel.cpp Thu Dec 07 10:13:13 2017 +0000 @@ -41,12 +41,14 @@ { int result ; float value ; + char timestr[16] ; print_time(_sampled_time) ; value = get_value() ; printf(" accel = %.3f [%d samples]\n", value, _sample_count) ; + time2seq(_sampled_time, timestr) ; sprintf(_str_buf, - "{\"DEVICE\":\"ACCEL\",\"PN\":\"MMA8451Q\",\"VAL_X\":\"%.3f\",\"VAL_Y\":\"0\",\"VAL_Z\":\"0\",\"UNIT\":\"g\",\"S\":\"%06d\",\"E\":\"%d\"}", - value, time2seq(_sampled_time), _error_count) ; + "{\"DEVICE\":\"ACCEL\",\"PN\":\"MMA8451Q\",\"VAL_X\":\"%.3f\",\"VAL_Y\":\"0\",\"VAL_Z\":\"0\",\"UNIT\":\"g\",\"S\":\"%s\",\"E\":\"%d\"}", + value, timestr, _error_count) ; result = afero->setAttribute(1, _str_buf) ; if (result == afSUCCESS) { clear_value() ;