Lab4-00_measure_temperature_lite

Dependencies:   mbed HEPTA_SENSOR_lite HEPTA_EPS_lite

Files at this revision

API Documentation at this revision

Comitter:
heptasat2021
Date:
Fri Aug 20 12:29:35 2021 +0000
Parent:
1:ddac5ec89167
Commit message:
For Hepta-Sat Lite

Changed in this revision

HEPTA_CDH_lite.lib Show diff for this revision Revisions of this file
HEPTA_EPS_lite.lib Show annotated file Show diff for this revision Revisions of this file
HEPTA_SENSOR_lite.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/HEPTA_CDH_lite.lib	Wed Aug 11 03:50:32 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/users/heptasat2021/code/HEPTA_CDH_lite/#d78a8add1c5e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_EPS_lite.lib	Fri Aug 20 12:29:35 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/heptasat2021/code/HEPTA_EPS_lite/#d5bf433a0032
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_SENSOR_lite.lib	Fri Aug 20 12:29:35 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/heptasat2021/code/HEPTA_SENSOR_lite/#82c6d3329af2
--- a/main.cpp	Wed Aug 11 03:50:32 2021 +0000
+++ b/main.cpp	Fri Aug 20 12:29:35 2021 +0000
@@ -1,19 +1,17 @@
 #include "mbed.h"
-#include "HEPTA_CDH.h"
-HEPTA_CDH cdh(PB_5, PB_4, PB_3, PA_8, "sd");
+#include "HEPTA_EPS.h"
+#include "HEPTA_SENSOR.h"
+HEPTA_EPS eps(PA_0,PA_4);
+HEPTA_SENSOR sensor(PA_7,PB_7,PB_6,0xD0);
 Serial pc(USBTX,USBRX,9600);
 int main()
-{
-    pc.printf("Hello World!\n");
- 
-    mkdir("/sd/mydir", 0777);
- 
-    FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
-    if(fp == NULL) {
-        error("Could not open file for write\r\n");
+{   
+    float temp;
+    pc.printf("Temperature Sensor\r\n");
+    eps.turn_on_regulator(); //Turn on 3.3V converter
+    for(int i=0;i<10;i++){
+        sensor.temp_sense(&temp);
+        pc.printf("Temperature=%f[degC]\r\n",temp);
+        wait_ms(1000);
     }
-    fprintf(fp, "Hello my name is HEPTA\r\n");
-    fclose(fp);
- 
-    pc.printf("Goodbye World!\r\n");
 }
\ No newline at end of file