presentatie versie met potmeters enabled

Dependencies:   Encoder HIDScope mbed

Revision:
7:acf28eb906c4
Parent:
6:30afff8ae34a
Child:
8:f2f45be5a060
--- a/main.cpp	Thu Oct 29 11:15:29 2015 +0000
+++ b/main.cpp	Thu Oct 29 11:18:30 2015 +0000
@@ -197,11 +197,6 @@
 double mt1 = 0;
 // time
 double T1 = 4, T2 = T1 + 2, T3 = T2 + 6, T4 = T3 + 1, T5 = T4 + 6, T6 = T5 + 4, T7 = T6 + 4, T8 = T7 + 1;
-// x,y coordinates
-//double x1 = 55, y1 = -15;
-//double x2 = 55, y2 = 15;
-//double x3 = 65, y3 = 15;
-//double x4 = 65, y4 = -15;
 
 // pak beker
 double x1 = 50, y1 = -37;
@@ -336,14 +331,14 @@
     return input;
 }
     
-
+// funtion switches the direction that is controlled
 void switch_axes (double input1,double input2)
 {
     if(input1 > input_threshold && input2 > input_threshold)    // when both signals are above the threshold, add one to global counter
     {
         sw1++;
     }
-    if(sw1 == t_switch*controlfreq)           // if global counter > s*freq flip the bool.
+    if(sw1 == t_switch*controlfreq)           // if global counter > t*freq flip the bool.
     {
         switch_xy = !switch_xy;     
         led_right.write(!led_right.read());  // turn on led when switched
@@ -626,8 +621,6 @@
         if(program_button.read() == 0)
         {
            program = !program;  
-           rc1 = 0;
-           rc2 = 0; 
            wait(0.2);  
            while(program_button.read() == 0);           
         }