![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
vf
Dependencies: Servo ServoArm mbed
Fork of PES_Official by
Sources/Greifer.cpp
- Committer:
- EpicG10
- Date:
- 2017-05-11
- Revision:
- 15:915f8839fe48
- Parent:
- 13:6c1f8e35b242
- Child:
- 17:4e1be70bdedb
File content as of revision 15:915f8839fe48:
#include "Robot.h" #include "Declarations.h" Greifer::Greifer(Servo* greifer) { init(greifer); } Greifer::Greifer() { } void Greifer::init(Servo* greifer) { this->greifer = greifer; greifer->calibrate(0.0017f, 180.0f); greifer->position(60.0f); } int Greifer::take() { this->greifer->position(-155.0f); static int time = 0; if( time < 10 ){ time++; return 0; } else{ time = 0; return 1; } } int Greifer::leave() { this->greifer->position(60.0f); static int time = 0; if( time < 10 ){ time++; return 0; } else{ time = 0; return 1; } } void Greifer::nullPos() { this->greifer->position(0.0f); }