Spring 2014, ECE 4180 project, Georgia Institute of Technolgoy. This is the autonomous driver program for the Robotics Cat and Mouse program.
Dependencies: IMUfilter ADXL345_I2C mbed ITG3200 USBHost mbed-rtos
GameCode.h
- Committer:
- Strikewolf
- Date:
- 2014-04-30
- Revision:
- 3:0a6e4d139b86
- Parent:
- 1:dacf7db790f6
File content as of revision 3:0a6e4d139b86:
#define THRESHOLD 100
Serial pc(USBTX, USBRX);
void stop();
bool gameOver = false;
bool isGameOver(short x_hum, short y_hum, short x_cpu, short y_cpu)
{
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);
}