![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
vf
Dependencies: Servo ServoArm mbed
Fork of PES_Official by
Sources/Leiste.cpp
- Committer:
- beacon
- Date:
- 2017-05-18
- Revision:
- 17:4e1be70bdedb
- Parent:
- 15:915f8839fe48
File content as of revision 17:4e1be70bdedb:
#include "Robot.h" #include "Declarations.h" Leiste::Leiste(){ } Leiste::Leiste(Servo* leiste){ init(leiste); } void Leiste::init(Servo* leiste){ this->leiste = leiste; this->leiste->calibrate(0.0025f, 180.0f); this->leiste->position(UP_POS); } int Leiste::upToDown(){ static float pos=UP_POS; if(pos>DOWN_POS) { pos-=3; this->leiste->position(pos); return 0; } else{ pos = UP_POS; return 1; } } int Leiste::downToUp(){ static float pos=DOWN_POS; if(pos<UP_POS) { pos+=3; this->leiste->position(pos); return 0; } else{ pos = DOWN_POS; return 1; } }