/* --------------------------------------------------------------------------- | Filename: react.c | | Authors: Thomas Braunl | | Description: reaction test | ------------------------------------------------------------------------- */ #include "eyebot.h" #include int main() { int time, old,new; LCDPrintf(" Reaction Test\n"); LCDMenu("GO"," "," "," "); KEYWait(ANYKEY); time = 100 + (int) (700.00 * rand() / RAND_MAX); /* 1..8 s in sec/100 */ LCDMenu(" "," "," "," "); OSWait(time); LCDMenu("HIT","HIT","HIT","HIT"); if (KEYRead()) LCDPrintf("no cheating !!\n"); else { old = OSGetCount(); KEYWait(ANYKEY); new = OSGetCount(); LCDPrintf("time: %1.2f\n", (float)(new-old) / 100.0); } LCDMenu(" "," "," ","END"); KEYWait(KEY4); return 0; }