stefan pushed a commit to branch master.
commit 1316de8fd3afbe067ffdfc31900c76640b252e12
Author: Stefan Schmidt <[email protected]>
Date: Wed Apr 17 13:11:10 2013 +0100
eeze/sensor: Add temperature sensor to my testing code
---
src/bin/eeze/eeze_sensor_test.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/bin/eeze/eeze_sensor_test.c b/src/bin/eeze/eeze_sensor_test.c
index 56eae9f..dcf6991 100644
--- a/src/bin/eeze/eeze_sensor_test.c
+++ b/src/bin/eeze/eeze_sensor_test.c
@@ -141,7 +141,19 @@ main(void)
else
printf("Could not find a light sensor!\n");
- printf("=== Test snyc read update: ===\n");
+ sens = eeze_sensor_new(EEZE_SENSOR_TYPE_TEMPERATURE);
+ if (sens)
+ {
+ if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");
+ if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get
accuracy\n");
+ if (!eeze_sensor_timestamp_get(sens, ×tamp)) printf("fail get
timestamp\n");
+ printf("Temperature output: accuracy %i, temperature %f °C at time:
%f\n", acc, x, timestamp);
+ eeze_sensor_free(sens);
+ }
+ else
+ printf("Could not find a temperature sensor!\n");
+
+ printf("=== Test sync read update: ===\n");
/* Get updated values on a sensor. This readout is synchronous. This way we
* can force a read out of the physical sensor instead of using the cached
* values. Depending on the hardware this can take a long time. If you
don't have special
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter