alles in elkaar met de mooie manier van de regelaar

Dependencies:   Encoder HIDScope MODSERIAL TouchButton mbed-dsp mbed

Fork of Robot2mooiemanier by BMT M9 Groep01

Files at this revision

API Documentation at this revision

Comitter:
Tanja2211
Date:
Thu Oct 30 14:29:46 2014 +0000
Parent:
3:68b364036bc8
Child:
5:8f256c16fe6c
Commit message:
hij gaat heen en weer en stopt :)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Oct 30 14:13:24 2014 +0000
+++ b/main.cpp	Thu Oct 30 14:29:46 2014 +0000
@@ -15,7 +15,7 @@
 #define WACHTEN 1
 #define SLAAN 2
 #define TERUGKEREN 3
-#define ANGLEMAX 251
+#define ANGLEMAX -251
 #define ANGLEMIN 0
 
 //initiating functions
@@ -611,7 +611,7 @@
 void motor1aansturing()
 {
 
-    if (abs(motor1.getPosition())== ANGLEMIN && toestand != SLAAN) {
+    if (motor1.getPosition()>= ANGLEMIN && toestand != SLAAN) {
         toestand = WACHTEN; 
         pc.printf("if1\n");
     }
@@ -628,7 +628,7 @@
             setspeed = V1; pc.printf("Snel 1 \n");
         }
     }
-    if (toestand == SLAAN && abs(motor1.getPosition()) >= ANGLEMAX) {
+    if (toestand == SLAAN && motor1.getPosition() <= ANGLEMAX) {
         pc.printf("toestand = terugkeren\n\r");
         toestand = TERUGKEREN; 
         stop = 1; //zorgt dat hij niet weer gaat slaan tot er gereset is...