Carlmaykel Orman / Mbed 2 deprecated NR_method_1

Dependencies:   HIDScope QEI biquadFilter mbed

Fork of NR_method by Thijs Rakels

Revision:
10:86c810be889a
Parent:
9:4fc2659cfb26
Child:
11:b1ad257e5647
Child:
14:1eee224b54d8
--- a/NR_method_1.cpp	Thu Nov 01 18:57:26 2018 +0000
+++ b/NR_method_1.cpp	Thu Nov 01 20:05:45 2018 +0000
@@ -139,24 +139,23 @@
         Led2 = 0;
         i = 0;
         Cxx =x1;
+        pc.printf("Moving in the x direction\n\r");
         if (dir == true) {
             if(x1 > -46.3) {
                 x1 = x1-4.2;
-                //return x1;
+ 
 
             } else if ( x1 <= -46.3) {
                 x1 =-17;
-                //return x1;
+
             } else {
             }
         } else {
             if(x1 < -17) {
                 x1 = x1+4.2;
-                //return x1;
 
             } else if ( x1 >= -17) {
                 x1 = -46.3;
-                //return x1;
             } else {
             }
         }
@@ -169,6 +168,7 @@
         Led2 = 0;
         i = 0;
         Cyy=y1;
+        pc.printf("Moving in the y direction\r\n");
         if(dir == true) {
             if(y1 < 32.4) {
                 y1 = y1+4.2;
@@ -371,6 +371,8 @@
 
 int main()
 {
+    pc.baud(115200);
+    pc.printf("Hello World!\r\n");
     Led = 1;
     Led2 = 0;
     M1 = 1;
@@ -391,6 +393,8 @@
     count3 = Enc2.getPulses();
     
     setCalibration();
+    pc.printf("Calibration is done\r\n");
+    pc.printf("Please press button SW3\n\r");
     Led2 = 1;
     button.fall(&change_wait);
     PMW1.period_us(60);
@@ -400,8 +404,8 @@
     X[1][0] = X0[1][0];
     Xold[0][0] = X0[0][0];
     Xold[1][0] = X0[1][0];
-    //pc.baud(115200);
     initializeren();
+    pc.printf("Initialization step done. Enjoy your game!\n\r");
     x1 = Cxx;
     y1= Cyy;
     bqc.add( &bq1 ).add( &bq2 );