eeze/sensor: Create a new sensor object for the async test.

Its a demo so we should do all the steps and create a new object
instead of re-using the other one.
This commit is contained in:
Stefan Schmidt 2013-03-27 12:03:32 +00:00
parent 2063e4353d
commit 2613394b66
1 changed files with 2 additions and 0 deletions

View File

@ -136,6 +136,7 @@ main(void)
if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
printf("Light output: accuracy %i, lux %f at time: %lli\n", acc, x, timestamp);
eeze_sensor_free(sens);
}
else
printf("Could not find a light sensor!\n");
@ -144,6 +145,7 @@ main(void)
* 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
* requirements the cached values should be used. */
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_LIGHT);
eeze_sensor_read(sens);
if (!sens) printf("can't find an light sensor!\n");
if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");