woravee chanlongrat / Mbed 2 deprecated Project_strian_guage_final

Dependencies:   HX711 mbed

Fork of 10B_Project_strian_guage_final by FRA221_2015

Revision:
2:b0a005b75d95
Parent:
1:7bfd7b4fb1a0
Child:
3:6a6ac3ec9462
--- a/main.cpp	Tue Dec 08 16:52:06 2015 +0000
+++ b/main.cpp	Tue Dec 08 21:15:03 2015 +0000
@@ -4,18 +4,27 @@
 #define standard_poid (float)0.030
 #define standard_kilo (float)0.2
 Serial pc(USBTX,USBRX);
-//Serial da(PA_11,PA_12);
 DigitalIn setzero_switch(D15);
-//DigitalOut LED(D14);
+DigitalOut LED(D14);
+
 //Serial pc(D8,D2);
-HX711 mudule1(A1, A0);
-HX711 mudule2(A3, A2);
+HX711 mudule2(A1, A0);
+HX711 mudule4(A3, A2);
 HX711 mudule3(A5, A4);
-HX711 mudule4(D3, D4);
+HX711 mudule1(D3, D4);
 HX711 mudule5(D5, D6);
 HX711 mudule6(D7, D9);
 HX711 mudule7(D10, D11);
 HX711 mudule8(D12, D13);
+/*
+HX711 mudule1(A1, A0);
+HX711 mudule2(A3, A2);
+HX711 mudule3(A5, A4);
+HX711 mudule4(D3, D2);
+HX711 mudule5(D5, D6);
+HX711 mudule6(D7, D9);
+HX711 mudule7(D10, D11);
+HX711 mudule8(D12, D13);*/
 float find_kilo(float valeur,float valeurTare);
 class Find_kg
 {
@@ -31,6 +40,7 @@
 
 int main()
 {
+
     pc.printf("START Application !\n");
     pc.baud(115200);
     Find_kg strain_guage_1;
@@ -66,6 +76,7 @@
     float module1,module2,module3,module4;
     float module5,module6,module7,module8;
     int gram_output;
+    //int state_mass =0;
     int state_select=0;
     float kilo_output;
     float kilo_output1,kilo_output2;
@@ -74,6 +85,7 @@
     int kilo_calibrate[4];
     int kilo_calibrate_8plate[8];
     int state_onemass=0,state_multiple_mass=0;
+    pc.printf("START Application !\n");
     while(1) {
         if(state_show == 0) {
             pc.printf("Select Menu !\n");
@@ -111,7 +123,7 @@
                         module2=0;
                         module3=0;
                         module4=0;
-                        //wait_ms(1000);
+                        wait_ms(1000);
                         valeur1 = mudule1.getValue();
                         valeur2 = mudule2.getValue();
                         valeur3 = mudule3.getValue();
@@ -752,6 +764,7 @@
                             pc.printf("8 plate function : Please calibrate mass of each plate. \n");
                             state_select=1;
                         }
+                        LED=1;
                         module1=0;
                         module2=0;
                         module3=0;
@@ -2833,6 +2846,7 @@
                             state_onemass=0;
                             state_multiple_mass=0;
                             state_select=0;
+                            LED=0;
                         }
                         
                     } while(state_exit ==0);
@@ -2851,6 +2865,7 @@
 
                          } while(state_exit ==0);
                     break;
+
                     
                 default:
                     pc.printf("plase select menu 1 , 2 or 3 only\n");