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:
5:210cd333f770
Child:
6:3fb9f96765f6

File content as of revision 5:210cd333f770:

#define THRESHOLD 500

Serial pc(USBTX, USBRX);

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");
    exit(1);
}