Julian Roll
/
IF_Task1
If_Task1
Revision 0:cd8d2f27aae1, committed 2015-04-16
- Comitter:
- Pouter123
- Date:
- Thu Apr 16 12:51:12 2015 +0000
- Commit message:
- If_Task1
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bertl_Ifnew.cpp Thu Apr 16 12:51:12 2015 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" +#include "ur_Bertl.h" +#include "const.h" +#include "Bertl_Ifnew.h" + +bool Bertl_Ifnew :: LeftIsBlocked() +{ + bool blocked; + TurnLeft(); + blocked = !FrontIsClear(); + TurnLeft(); + TurnLeft(); + TurnLeft(); + + return blocked; +} + + +bool Bertl_Ifnew :: FrontIsClear_AND_BTN_FLL_NotPressed() +{ + if(FrontIsClear() && !IsButtonPressed(BTN_FLL)) + return true; + + else + return false; +} + +bool Bertl_Ifnew :: FrontIsClear_OR_BTN_FLL_Pressed() +{ + if(FrontIsClear() || IsButtonPressed(BTN_FLL)) + return true; + + else + return false; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bertl_Ifnew.h Thu Apr 16 12:51:12 2015 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +#include "ur_Bertl.h" +#include "const.h" + +#ifndef BERTL_IFNEW +#define BERTL_IFNEW + +class Bertl_Ifnew : public ur_Bertl +{ + public: + bool LeftIsBlocked(); + bool FrontIsClear_AND_BTN_FLL_NotPressed(); + bool FrontIsClear_OR_BTN_FLL_Pressed(); +}; +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 16 12:51:12 2015 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" +#include "ur_Bertl.h" +#include "const.h" +#include "Bertl_Ifnew.h" + + +int main() { + Bertl_Ifnew karel; + + for(int i = 0; i <= 10; i++) + { + if(karel.FrontIsClear_AND_BTN_FLL_NotPressed()) + karel.Move(); + + for(int o = 0; o <= 60000; o++){} + + } + + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 16 12:51:12 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ur_Bertl.lib Thu Apr 16 12:51:12 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#e7f74f072564