Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: IMUfilter ADXL345_I2C mbed ITG3200 USBHost mbed-rtos
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 }
Generated on Thu Jul 14 2022 12:11:48 by
1.7.2