![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Rev 1.0
Fork of MotorTest by
Dist2Wall_US.cpp
- Committer:
- hollegha2
- Date:
- 2015-04-21
- Revision:
- 3:78f03f96d641
- Parent:
- MotorTest.cpp@ 1:ef44156a6e44
File content as of revision 3:78f03f96d641:
#include "mbed.h" #include "Serial_HL.h" #include "Bertl14.h" #include "BertlObjects.h" void DriveUntilObstacle(); void Turn180(); int main(void) { InitBertl(); pex.ClearLeds(); // Damit der Roboter nicht gleich loskoffert leds = 9; pex.WaitUntilFrontButtonPressed(); leds=6; wait(0.8); pex.WaitUntilFrontButtonPressed(); leds=0; // 2x Button-pressed jetzt gehts los while(1) { DriveUntilObstacle(); wait(0.5); // Debug wait Turn180(); wait(0.5); } return 1; } void DriveUntilObstacle() { // Motoren ein // in einer While-Schleife warten bis Distanz kleiner MinDistance // Motoren aus !!! } void Turn180() { // Motoren auf 0.5 bis 0.7 // in einer While-Schleife warten bis // bei !!!beiden!!! Motoren die Ticks für eine 180° Drehung erreicht sind // Motoren aus }