Maxi Pickl
/
Bertl_uebungen
Clear All Beeper To The Wall
Diff: main.cpp
- Revision:
- 2:9795f864acac
- Parent:
- 1:fe621d794c6c
diff -r fe621d794c6c -r 9795f864acac main.cpp --- a/main.cpp Fri Apr 24 09:17:13 2015 +0000 +++ b/main.cpp Thu May 07 12:24:26 2015 +0000 @@ -10,11 +10,49 @@ #include "ur_Bertl.h" #include "const.h" +Serial bt(p9, p10); + int main() { + int xy = 5; + char zeichen; + Task_Bertl karel; - karel.LedAmpel(); + int Beeper = 0; + int Moves = 1; + + while(true) + { + bt.printf("Move time: %d, Beeper: %d\n", Moves, Beeper); + uint8_t val = karel.GetLineValues(); + + karel.Move(); + Moves++; + + if (karel.NextToABeeper()) + { + Beeper++; + } + } +} + + /*while(true) + { + bt.printf("Zeichen eingeben: "); + bt.scanf("%c", &zeichen); + bt.print("Hello Bertl: %d \n", xy, zeichen); + wait(1); + }*/ + + /*while(1) + { + uint8_t val = karel.GetLineValue(); + karel.NibbleLeds(val); + }*/ + + + //karel.LedAmpel(); /*while(1) { @@ -31,5 +69,27 @@ }*/ // karel.ClearAllBeeperToTheWall(); + +/* int main() +{ + Bertl karel; + + karel.TurnLedOff(LED_ALL); + while(1) + { + uint8_t val = karel.GetLineValues(); + karel.NibbleLeds(val); + + if(val == 6) + { + karel.Move(); + } + + if(val != 6) + { + karel.TurnLeftStep(1); + } + } } +}*/