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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GameCode.h Source File

GameCode.h

00001 #define THRESHOLD 100
00002 
00003 Serial pc(USBTX, USBRX);
00004 
00005 void stop();
00006 
00007 bool gameOver = false;
00008 
00009 bool isGameOver(short x_hum, short y_hum, short x_cpu, short y_cpu)
00010 {
00011     if(abs(x_hum - x_cpu) < THRESHOLD && abs(y_hum - y_cpu) < THRESHOLD) {
00012         return true;
00013     } else {
00014         return false;
00015     }
00016 }
00017 
00018 void endGame()
00019 {
00020     pc.printf("GAME OVER\n\r");
00021     stop();
00022     exit(1);
00023 }