hepta

Dependencies:   HEPTA_EPS HEPTA_SENSOR mbed

Revision:
25:2754ee64f27f
Parent:
24:3659e0c223c8
Child:
26:f626e6c421af
--- a/main.cpp	Wed Aug 21 18:02:15 2019 +0000
+++ b/main.cpp	Wed Aug 21 20:55:35 2019 +0000
@@ -1,53 +1,19 @@
 #include "mbed.h"
 #include"HEPTA_EPS.h"
-#include"HEPTA_CDH.h"
 #include"HEPTA_SENSOR.h"
-#include"HEPTA_COM.h"
-
-#include "mbed.h"
- 
-Serial pc(USBTX,USBRX);
- 
-DigitalOut myleds[] = {LED1,LED2,LED3,LED4};;
- 
-int rcmd = 0,cmdflag = 0;
  
-void commandget()
-{
-    rcmd=pc.getc();
-    cmdflag = 1;
-}
-void receive(int *xrcmd, int *xcmdflag)
-{
-    pc.attach(commandget,Serial::RxIrq);
-    *xrcmd = rcmd;
-    *xcmdflag = cmdflag;
-}
- 
-void initialize()
-{
-    rcmd = 0;
-    cmdflag = 0;
-}
- 
+Serial pc(USBTX, USBRX);
+HEPTA_EPS eps(p16,p26);
+HEPTA_SENSOR sensor(p17, 
+                    p28,p27,0xD0,0x18,
+                    p13, p14,p25,p24);
 int main()
 {
     pc.baud(9600);
-    receive(&rcmd,&cmdflag);
-    while(1) {
-        myleds[0] = 1;
-        wait(0.5);
-        myleds[0] = 0;
-        wait(0.5);
-        if (cmdflag == 1) {
-            if (rcmd == 'a') {
-               //Please enter your answer in this part
-               
-               
-               
-               //
-            }
-            initialize();
-        }
+    float temp;
+    for (int i=0;i<10;i++) {
+        sensor.temp_sense(&temp);
+        pc.printf("temp = %f\r\n",temp);
+        wait(1.0);
     }
 }
\ No newline at end of file