![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
x
Dependencies: Servo ServoArm mbed
Fork of PES_PIXY_Officiall by
Diff: Sources/Greifer.cpp
- Revision:
- 3:63da1d1fae15
- Parent:
- 2:c8c965d48f8d
- Child:
- 5:acb938f45b9c
--- a/Sources/Greifer.cpp Thu May 25 18:12:28 2017 +0000 +++ b/Sources/Greifer.cpp Fri May 26 08:01:48 2017 +0000 @@ -1,11 +1,6 @@ #include "Robot.h" #include "Declarations.h" - - - - - Greifer::Greifer(Servo* greifer) { init(greifer); @@ -16,20 +11,16 @@ } -void Greifer::init(Servo* greifer) -{ +void Greifer::init(Servo* greifer){ this->greifer = greifer; greifer->calibrate(0.001f, 90.0f); greifer->position(65.0f); } -int Greifer::take() - -{ +int Greifer::take(){ this->greifer->position(-60.0f); static int time = 0; if( time < 300 ){ - this->greifer->position(-60.0f); time++; return 0; } @@ -39,8 +30,7 @@ } } -int Greifer::leave() -{ +int Greifer::leave(){ this->greifer->position(65.0f); static int time = 0; if( time < 350 ){ @@ -52,8 +42,3 @@ return 1; } } - -void Greifer::nullPos() -{ - this->greifer->position(0.0f); -} \ No newline at end of file