a

Dependencies:   Servo ServoArm mbed

Fork of PES_Official-TestF by zhaw_st16b_pes2_10

Revision:
11:292bdbd85a9c
Parent:
10:f76476943a6c
Child:
12:c0bcb95885dd
--- a/Sources/Arm.cpp	Wed May 03 13:54:51 2017 +0000
+++ b/Sources/Arm.cpp	Sat May 06 13:33:23 2017 +0000
@@ -16,46 +16,50 @@
     this->arm->position(COLLECT_POS);
 }
 
-void Arm::collecttodown(int* done){
+int Arm::collectToDown(){
     static float pos=COLLECT_POS;
     if(pos>TAKE_POS) {
-        pos-=1;
+        pos-=3;
         this->arm->position(pos);
+        return 0;
     }
     else{
-        *done = 1;
+        return 1;
     }
 }
 
-void Arm::downtocollect(int* done){
+int Arm::downToCollect(){
     static float pos=TAKE_POS;
     if(pos<COLLECT_POS) {
-        pos+=1;
+        pos+=3;
         this->arm->position(pos);
-        }
+        return 0;
+    }
     else{
-        *done = 1;
+        return 1;
     }
 }
 
-void Arm::collecttoback(int* done){
+int Arm::collectToBack(){
     static float pos=COLLECT_POS;
     if(pos<RELEASE_POS) {
-        pos+=1;
+        pos+=3;
         this->arm->position(pos);
+        return 0;
         }
     else{
-        *done = 1;
+        return 1;
     }
 }
 
-void Arm::backtocollect(int* done){
+int Arm::backToCollect(){
     static float pos=RELEASE_POS;
     if(pos>COLLECT_POS) {
-        pos-=1;
+        pos-=3;
         this->arm->position(pos);
+        return 0;
         }
     else{
-        *done = 1;
+        return 1;
     }
 }
\ No newline at end of file