tes ir atas semua

Dependencies:   mbed ADS1115 StepperMotor SRF05 TPA81new

Revision:
9:ba07c0b8899f
Parent:
8:5e1854c119ba
Child:
10:8722053fb75c
--- a/main.cpp	Tue Feb 13 16:29:00 2018 +0000
+++ b/main.cpp	Fri Feb 16 12:36:40 2018 +0000
@@ -68,7 +68,7 @@
     float ir_o = 0;
     float snd_o = 0;
     float uv_o = 0;
-    int ext = 0;        // Extinguisher state
+    int ext = 1;        // Extinguisher state
     
     int tcal = 0;   // Toggle calibration
     int fcal = 0;   // Force calibration
@@ -89,6 +89,12 @@
     int16_t mx,my,mz;
     cmp.reset();
     
+    // Motor switching test
+    m2 = 0;
+    m1 = 0;
+    
+    wait(1);
+    
     while (1) {
         // LCD
         lcd.printf("%.1f L%.2f|%.2f\n", ir_o, line1_o, line2_o);
@@ -107,7 +113,6 @@
         // Extinguisher (12V output)
         m2 = ext;
         m1 = ext;
-        ext = !ext; // Switching test
         
         // LED
         led1 = 1;
@@ -157,6 +162,10 @@
                     pc.printf("Compass Calib\n");
                     fcal = !fcal;
                     break;
+                case 'm':
+                    pc.printf("Motor toggle\n");
+                    ext = !ext;
+                    break;
             }
             // pc.putc(ser_i);  // Display serial input
         }