sibren vuurberg / Mbed 2 deprecated Project_code_groep12

Dependencies:   MODSERIAL QEI mbed

Fork of EMG_check by sibren vuurberg

Files at this revision

API Documentation at this revision

Comitter:
sivuu
Date:
Fri Oct 28 12:14:20 2016 +0000
Parent:
25:31179ebc3582
Child:
27:be2be9600e2d
Child:
29:5de90b30c68d
Commit message:
hele script met werkende restricties

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Oct 28 11:22:42 2016 +0000
+++ b/main.cpp	Fri Oct 28 12:14:20 2016 +0000
@@ -245,7 +245,19 @@
     pwm_motor2=0;
     pwm_motor1=0;
     }              
-      
+   if (rev_counts_motor1 <-3.4 && richting_motor1 == 0){
+      pwm_motor1=0;
+      }
+    else if(rev_counts_motor1 >3.4 && richting_motor1 == 1){
+    pwm_motor1 =0;
+    }
+    
+  if (rev_counts_motor2 < -4.0 && richting_motor2 == 1){
+        pwm_motor2=0;
+           }
+    else if (rev_counts_motor2 > 4.0 && richting_motor2 == 0){
+           pwm_motor2==0;
+           }
            
 }
 }