โปรแกรมdetect น้ำหนักของแผ่น strain guage

Dependencies:   HX711 mbed

Fork of 10B_Project_strian_guage_final by FRA221_2015

Revision:
4:39f57513fb2b
Parent:
3:6a6ac3ec9462
--- a/main.cpp	Wed Dec 09 00:01:20 2015 +0000
+++ b/main.cpp	Wed Dec 09 00:15:50 2015 +0000
@@ -221,7 +221,7 @@
                                     else
                                     { 
                                         kilo_output =0;
-                                        //pc.printf("Undetect mass of 4 plate.\n");
+                                        pc.printf("Undetect mass of 4 plate.\n");
                                     }
                                     
                                     
@@ -983,7 +983,7 @@
                                     else
                                     { 
                                         kilo_output =0;
-                                        //pc.printf("Undetect mass of 4 plate.\n");
+                                        pc.printf("Undetect mass of 4 plate.\n");
                                     }
                                     
                                     
@@ -1219,6 +1219,10 @@
                                         pc.printf("Mass 1 of third plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and second plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2>standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1243,6 +1247,10 @@
                                         pc.printf("Mass 1 of fourth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and second plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1267,6 +1275,10 @@
                                         pc.printf("Mass 1 of fifth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and second plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1291,6 +1303,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and second plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -1315,6 +1331,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and second plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1339,6 +1359,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and second plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3>standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1363,6 +1387,10 @@
                                         pc.printf("Mass 1 of fourth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                  else if(module1>standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1387,6 +1415,10 @@
                                         pc.printf("Mass 1 of fifth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                  else if(module1>standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1411,6 +1443,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                  else if(module1>standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -1435,6 +1471,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                  else if(module1>standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1459,6 +1499,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1483,6 +1527,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1507,6 +1555,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -1531,6 +1583,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1555,6 +1611,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1579,6 +1639,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and sixth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8>standard_kilo)
                                 {
@@ -1603,6 +1667,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between first plate and seventh plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                  else if(module1<standard_kilo && module2>standard_kilo && module3>standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1627,6 +1695,10 @@
                                         pc.printf("Mass 1 of fourth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                  else if(module1<standard_kilo && module2>standard_kilo && module3>standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1651,6 +1723,10 @@
                                         pc.printf("Mass 1 of fifth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and third plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4>standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1675,6 +1751,10 @@
                                         pc.printf("Mass 1 of fifth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1699,6 +1779,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -1723,6 +1807,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1747,6 +1835,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1771,6 +1863,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -1795,6 +1891,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1819,6 +1919,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and sixth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2>standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8>standard_kilo)
                                 {
@@ -1843,6 +1947,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between second plate and seventh plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4>standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1867,6 +1975,10 @@
                                         pc.printf("Mass 1 of fifth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4>standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1891,6 +2003,10 @@
                                         pc.printf("Mass 1 of fifth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4>standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1915,6 +2031,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -1939,6 +2059,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -1963,6 +2087,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fourth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5>standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -1987,6 +2115,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -2011,6 +2143,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -2035,6 +2171,10 @@
                                         pc.printf("Mass 1 of eighth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -2059,6 +2199,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and eighth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3>standard_kilo && module4<standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8>standard_kilo)
                                 {
@@ -2083,6 +2227,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between third plate and eighth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4>standard_kilo && module5>standard_kilo && module6>standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -2107,6 +2255,10 @@
                                         pc.printf("Mass 1 of sixth plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fourth plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4>standard_kilo && module5>standard_kilo && module6<standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -2131,6 +2283,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fourth plate and fifth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6>standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -2155,6 +2311,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fourth plate and sixth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6>standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -2179,6 +2339,10 @@
                                         pc.printf("Mass 1 of eight plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fourth plate and sixth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7>standard_kilo && module8>standard_kilo)
                                 {
@@ -2203,6 +2367,10 @@
                                         pc.printf("Mass 1 of eight plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fourth plate and seventh plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6>standard_kilo && module7>standard_kilo && module8<standard_kilo)
                                 {
@@ -2227,6 +2395,10 @@
                                         pc.printf("Mass 1 of seventh plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fifth plate and sixth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6>standard_kilo && module7<standard_kilo && module8>standard_kilo)
                                 {
@@ -2251,6 +2423,10 @@
                                         pc.printf("Mass 1 of eight plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fifth plate and sixth plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5>standard_kilo && module6<standard_kilo && module7>standard_kilo && module8>standard_kilo)
                                 {
@@ -2275,6 +2451,10 @@
                                         pc.printf("Mass 1 of eight plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between fifth plate and seventh plate = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1<standard_kilo && module2<standard_kilo && module3<standard_kilo && module4<standard_kilo && module5<standard_kilo && module6>standard_kilo && module7>standard_kilo && module8>standard_kilo)
                                 {
@@ -2299,6 +2479,10 @@
                                         pc.printf("Mass 1 of eight plate  = %.3f kg.\n",kilo_output1);
                                         pc.printf("Mass 2 between sixth plate and seventh plate1 = %.3f kg.\n",kilo_output2);
                                      }
+                                     else
+                                        {
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
+                                        }
                                 }
                                 else if(module1>standard_kilo && module2>standard_kilo && module3>standard_kilo && module4>standard_kilo && module5<standard_kilo && module6<standard_kilo && module7<standard_kilo && module8<standard_kilo)
                                 {
@@ -2327,7 +2511,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module2>module1 && module2>module3 && module2>module4)
@@ -2355,7 +2539,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module3>module1 && module3>module2 && module3>module4)
@@ -2383,7 +2567,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module4>module1 && module4>module2 && module4>module3)
@@ -2411,7 +2595,7 @@
                                         }
                                         else
                                         {          
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                                  pc.printf("Mass 1 = 0 kg\nMass 2 = 0 kg\n");
                                         }
                                     }
@@ -2444,7 +2628,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module4>module3 && module4>module5 && module4>module6)
@@ -2472,7 +2656,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module5>module3 && module5>module4 && module5>module6)
@@ -2500,7 +2684,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module6>module3 && module6>module4 && module6>module5)
@@ -2528,7 +2712,7 @@
                                         }
                                         else
                                         {          
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                                  pc.printf("Mass 1 = 0 kg\nMass 2 = 0 kg\n");
                                         }
                                     }
@@ -2560,7 +2744,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module6>module5 && module6>module7 && module6>module8)
@@ -2588,7 +2772,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module7>module5 && module7>module6 && module7>module8)
@@ -2616,7 +2800,7 @@
                                         }
                                         else
                                         {
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                         }
                                     }
                                     else if(module8>module5 && module8>module6 && module8>module7)
@@ -2644,7 +2828,7 @@
                                         }
                                         else
                                         {          
-                                                 pc.printf("Undefind weight (have 2 mass on 4 plate).\n");
+                                                 pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                                  pc.printf("Mass 1 = 0 kg\nMass 2 = 0 kg\n");
                                         }
                                     }
@@ -2824,6 +3008,7 @@
                                         else
                                          {
                                               pc.printf("Kilogram of mass : 0 kg\n");
+                                              pc.printf("Undefind weight (have 2 mass on 8 plate).\n");
                                          }
                             }
                         
@@ -2835,11 +3020,13 @@
                                      if(state_output==0) 
                                     {
                                         pc.printf("Kilogram of mass : 0 kg\n");
+                                        pc.printf("Undefind weight ).\n");
                                     }
                                     else if(state_output==1)
                                     {
                                         gram_output = kilo_output*1000;
                                         pc.printf("Gram of mass : 0 gram \n");
+                                        pc.printf("Undefind weight ).\n");
                                     }
                         }
                         if(pc.readable())