GoToBeeper2

Dependencies:   mbed

main.cpp

Committer:
Markus_Watko
Date:
2015-04-24
Revision:
0:58c13a57ed81

File content as of revision 0:58c13a57ed81:

#include "mbed.h"
#include "ur_Bertl.h"




int main() 
{
    ur_Bertl karel;
    
    bool x = true;
    int cnt = 0;
    
    do
    {
        karel.Move();
    
        if (karel.IsButtonPressed(0x80))
        {
            for(int i = 0; i <= 5; i++)
            {
                karel.NibbleLeds(0x0F);
                wait(0.1);
                karel.NibbleLeds(0x00);
                wait(0.1);
                cnt++;
            }
            
            if ( cnt >= 2)
            {
                x = false;    
            }
            
            karel.MoveBackwards();
            karel.TurnLeft(); 
           
           
        }   
        
       
    }while(x);
}