lyre liu / Mbed 2 deprecated project1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lyreliu
Date:
Tue Mar 08 14:36:02 2016 +0000
Parent:
12:623f562fc3db
Child:
14:b67ce99ccd48
Commit message:
program test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Mar 08 14:01:32 2016 +0000
+++ b/main.cpp	Tue Mar 08 14:36:02 2016 +0000
@@ -38,14 +38,14 @@
     }      
 }
 
-void MassCompute(float voltage)
+void MassCompute(float vol)
 {
     //float ratio;                    //The amplified factor of the OA
     float vol_ref;                  //Reference voltage, the basic voltage of the MCU, the default number is 3.3
     
     vol_ref = 3.3;
     
-    mass = 3000*vol_ref*voltage/RATIO + 0.3;        //The compute function of mass from the voltage
+    mass = 3000*vol_ref*vol/RATIO + 0.3;        //The compute function of mass from the voltage
 }
 
 void SerialInit(void)
@@ -73,7 +73,8 @@
     pc.printf("%c",start);
     //pc.printf("%c",mass_trans_high);
     //pc.printf("%c",mass_trans_low);
-    pc.printf("%c",voltage_test);
-    //pc.printf("%c",voltage_low);
+    
+    pc.printf("%c",voltage_high);
+    pc.printf("%c",voltage_low);
     pc.printf("%c",end);
 }
\ No newline at end of file