Tobis Programm forked to not destroy your golden files

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

source/StartUp.cpp

Committer:
cittecla
Date:
2017-05-15
Revision:
130:670a954495bf
Parent:
128:6bde4483ce7b
Child:
132:8ae08f41bb43

File content as of revision 130:670a954495bf:

#include "StartUp.h"

bool stb = false;
bool stb2 = false;
bool stb3 = false;

int idle()
{

    if(get_user() == false && stb) {
        return 15; // button pressed
    } else {
        stb = true;
        return 10;
    }
}

int idle2()
{

    if(get_user() == false && stb2) {
        return 25;
    } else {
        stb2 = true;
        wait_ms(100);
        return 11;
    }
}


int initialisation()
{
    Robot_init_all();
    return 16;
}


int inital_arm_positioning()
{
    open_grabber();
    if(arm_position_release()) {
        return 17;
    }
    return 16;
}


int initial_turn()
{

    if(stb3 == false) {
        stb3 = true;
        printf("initial turn...\r\n");
        turn_for_deg(180,1);
    } else {
        printf("turning...\r\n");
        if(turn_for_deg(0,1) < 0) { // check if turning complete
            // printf("turn finished...\r\n");
            //print_map(0);
            return 35;
        }
    }
    return 28;
}