lyre liu / Mbed 2 deprecated project1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lyreliu
Date:
Tue Mar 08 10:01:44 2016 +0000
Parent:
9:f4bfd06b3ef1
Child:
11:261f1ba05668
Commit message:
program %c

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Mar 08 08:13:18 2016 +0000
+++ b/main.cpp	Tue Mar 08 10:01:44 2016 +0000
@@ -1,6 +1,6 @@
 #include "mbed.h"
 #define RATIO 1                      //The amplified factor of the OA  ??????????????????????????????????????????????????
-#define SAMPLE_TIME 100             // Sample time, default is 100ms
+#define SAMPLE_TIME 500             // Sample time, default is 100ms
 void MassCompute(float);            // The function of computing mass from voltage.
 void SerialInit(void);              // The function fo serial initial
 void SerialTransmit(void);          // Transmit the data through the serial
@@ -57,17 +57,17 @@
     unsigned char start,end,test1,test2;
     start = 0xfe;
     end   = 0xff;
-    test1 = '%';
-    test2 = '$';
+    //test1 = '%';
+    //test2 = '$';
     if(mass>3)
         mass =3;
-    //mass_trans_low = (unsigned char)(mass*10000);
-    //mass_trans_high = (unsigned char)(mass*10000)>>8;
+    mass_trans_low = (unsigned char)(mass*10000);
+    mass_trans_high = (unsigned char)(mass*10000)>>8;
     
-    pc.printf("%u",start);
-    //pc.printf("%u",mass_trans_high);
-    //pc.printf("%u",mass_trans_low);
-    pc.printf("%u",test1);
-    pc.printf("%u",test2);
-    pc.printf("%u",end);
+    pc.printf("%c",start);
+    pc.printf("%c",mass_trans_high);
+    pc.printf("%c",mass_trans_low);
+    //pc.printf("%c",test1);
+    //pc.printf("%c",test2);
+    pc.printf("%c",end);
 }
\ No newline at end of file