temp sensor for the expansion board with a time stamp in epoch, variables to change are offset, and the wait(x). x should be in seconds, warns fixed
Dependencies: mbed X_NUCLEO_IKS01A2
Revision 20:91a73ab0c894, committed 2020-12-23
- Comitter:
- evanjp05
- Date:
- Wed Dec 23 00:17:12 2020 +0000
- Parent:
- 19:c276649e8e4a
- Commit message:
- fixed warns;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Dec 23 00:10:37 2020 +0000
+++ b/main.cpp Wed Dec 23 00:17:12 2020 +0000
@@ -49,7 +49,7 @@
//static LSM303AGRMagSensor *magnetometer = mems_expansion_board->magnetometer;
static HTS221Sensor *hum_temp = mems_expansion_board->ht_sensor;
static LPS22HBSensor *press_temp = mems_expansion_board->pt_sensor;
-int offset = 5;
+float offset = 5;
float F;
@@ -94,8 +94,8 @@
uint8_t id;
//in order to calibrate the temp sensor
- float value1, value2;
- //char buffer1[32], buffer2[32];
+ float value1;
+ char buffer1[32];
//int32_t axes[3];
/* Enable all sensors */
@@ -124,7 +124,7 @@
hum_temp->get_temperature(&value1);
time_t seconds = time(NULL);
- F = ((value1 * 9.0) / 5.0 + 32) - offset;
+ F = ((value1 * 9) / 5 + 32) - offset;
printf("%u, ", (unsigned int)seconds);