Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo ServoArm mbed
Fork of PES_Official by
Leiste.cpp
00001 #include "Robot.h" 00002 #include "Declarations.h" 00003 00004 00005 Leiste::Leiste(){ 00006 } 00007 00008 Leiste::Leiste(Servo* leiste){ 00009 init(leiste); 00010 } 00011 00012 void Leiste::init(Servo* leiste){ 00013 this->leiste = leiste; 00014 this->leiste->calibrate(0.0025f, 180.0f); 00015 this->leiste->position(UP_POS); 00016 } 00017 00018 int Leiste::upToDown(){ 00019 static float pos=UP_POS; 00020 if(pos>DOWN_POS) { 00021 pos-=3; 00022 this->leiste->position(pos); 00023 return 0; 00024 } 00025 else{ 00026 pos = UP_POS; 00027 return 1; 00028 } 00029 } 00030 00031 int Leiste::downToUp(){ 00032 static float pos=DOWN_POS; 00033 if(pos<UP_POS) { 00034 pos+=3; 00035 this->leiste->position(pos); 00036 return 0; 00037 } 00038 else{ 00039 pos = DOWN_POS; 00040 return 1; 00041 } 00042 }
Generated on Sun Jul 17 2022 01:45:57 by
