Evan Pierce / Mbed 2 deprecated HelloWorld_IKS01A2_final

Dependencies:   mbed X_NUCLEO_IKS01A2

Files at this revision

API Documentation at this revision

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);