vf
Dependencies: Servo ServoArm mbed
Fork of PES_Official by
Diff: Sources/Arm.cpp
- Revision:
- 10:f76476943a6c
- Parent:
- 7:6fed0dcae9c1
- Child:
- 11:292bdbd85a9c
diff -r 6fed0dcae9c1 -r f76476943a6c Sources/Arm.cpp --- a/Sources/Arm.cpp Tue May 02 08:00:19 2017 +0000 +++ b/Sources/Arm.cpp Wed May 03 13:54:51 2017 +0000 @@ -5,22 +5,22 @@ Arm::Arm(){ } -Arm::Arm(Servo* servoArm){ - init(servoArm); +Arm::Arm(ServoArm* arm){ + init(arm); } -void Arm::init(Servo* servoArm){ - this->servoArm = servoArm; +void Arm::init(ServoArm* arm){ + this->arm = arm; - this->servoArm->calibrate(0.008f, 90.0f); - this->servoArm->position(COLLECT_POS); + this->arm->calibrate(0.0015f, 180.0f); + this->arm->position(COLLECT_POS); } void Arm::collecttodown(int* done){ static float pos=COLLECT_POS; if(pos>TAKE_POS) { pos-=1; - this->servoArm->position(pos); + this->arm->position(pos); } else{ *done = 1; @@ -31,7 +31,7 @@ static float pos=TAKE_POS; if(pos<COLLECT_POS) { pos+=1; - this->servoArm->position(pos); + this->arm->position(pos); } else{ *done = 1; @@ -42,7 +42,7 @@ static float pos=COLLECT_POS; if(pos<RELEASE_POS) { pos+=1; - this->servoArm->position(pos); + this->arm->position(pos); } else{ *done = 1; @@ -53,7 +53,7 @@ static float pos=RELEASE_POS; if(pos>COLLECT_POS) { pos-=1; - this->servoArm->position(pos); + this->arm->position(pos); } else{ *done = 1;