Spring 2014, ECE 4180 project, Georgia Institute of Technolgoy. This is the human driver (RF controller) program for the Robotics Cat and Mouse program.

Dependencies:   ADXL345_I2C_NEST HMC6352 IMUfilter ITG3200_NEST USBHost mbed-rtos mbed

Fork of Project by Ganesh Subramaniam

GameCode.h

Committer:
Strikewolf
Date:
2014-04-30
Revision:
6:3fb9f96765f6
Parent:
5:210cd333f770

File content as of revision 6:3fb9f96765f6:

#define THRESHOLD 1000

Serial pc(USBTX, USBRX);
void stop();

bool gameOver = false;

bool isGameOver(double x_hum, double y_hum, double x_cpu, double y_cpu)
{
    pc.printf("AI:(%f, %f), HUM: (%f, %f)\n\r", x_cpu, y_cpu, x_hum, y_hum);
    if(abs(x_hum - x_cpu) < THRESHOLD && abs(y_hum - y_cpu) < THRESHOLD) {
        return true;
    } else {
        return false;
    }
}

void endGame()
{
    pc.printf("GAME OVER\n\r");
    stop();
    exit(1);
}