![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Bertl
Revision 0:9f717595fa8b, committed 2015-12-21
- Comitter:
- Michi_Jocham
- Date:
- Mon Dec 21 14:31:11 2015 +0000
- Commit message:
- bertl
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bertl.lib Mon Dec 21 14:31:11 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/Michi_Jocham/code/Bertl/#2a4fa405eec6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Dec 21 14:31:11 2015 +0000 @@ -0,0 +1,97 @@ +#include "mbed.h" +#include "const.h" +#include "Robot.h" +#include "ur_Bertl.h" +Robot bertl; +bool Ultraschallsensor () +{ + if(bertl.FrontIsClear()) + { + return true; + } + else + { + return false; + } + +} +void Alarmblinkanlage () +{ + bertl.TurnLedOn(LED_ALL_FRONT); + bertl.TurnLedOn(LED_ALL_BACK); + wait(0.1); + bertl.TurnLedOff(LED_ALL_FRONT); + bertl.TurnLedOff(LED_ALL_BACK); + +} +void FrontscheinwerferAn () +{ + bertl.TurnLedOn(LED_FL1); + bertl.TurnLedOn(LED_FR1); +} +void FrontscheinwerferAus () +{ + bertl.TurnLedOff(LED_FL1); + bertl.TurnLedOff(LED_FR1); +} + + + +void BlinkenLinks() +{ + int a=0; + int b=1; + while(a<b) + { + bertl.TurnLedOn(LED_BL1); + bertl.TurnLedOn(LED_FL2); + wait(0.1); + bertl.TurnLedOff(LED_BL1); + bertl.TurnLedOff(LED_FL2); + a++; + } +} + + +void BlinkenRechts() +{ + int a=0; + int b=1; + while(a<b) + { + bertl.TurnLedOn(LED_FR2); + bertl.TurnLedOn(LED_BR2); + wait(0.1); + bertl.TurnLedOff(LED_FR2); + bertl.TurnLedOff(LED_BR2); + a++; + } +} + + + +int main() +{ + + + while(1) + { + + + if(Ultraschallsensor()) + { + Alarmblinkanlage(); + bertl.MoveBackwards(); + BlinkenLinks(); + bertl.TurnLeft(); + bertl.Move(); + BlinkenRechts(); + bertl.TurnRigth(); + } + else + { + bertl.Move(); + } + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Dec 21 14:31:11 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/165afa46840b \ No newline at end of file