/* include handyboard.h to check against function definitions */ #include "handyboard.h" /* declare global reference time (typically # seconds since 1970.01.01) */ #include time_t gbl_ref_sec; int def_gbl_ref=0; /* declare global number of cos repetitions equivalent to 1 second */ long reps=1200000; int def_gbl_reps=0; int start_button (void) { printf("check start_button: answer is 1\n"); return 1; } int stop_button (void) { printf("check stop_button: answer is 0\n"); return 0; } int digital (int port) { int irandom; irandom = (random(4) == 0); printf("check digital(%d): answer is %d\n",port,irandom); return irandom; } void fd (int motor) { printf("fd(%d)\n",motor); } void bk (int motor) { printf("bk(%d)\n",motor); } void off (int motor) { printf("off(%d)\n",motor); } void alloff () { printf("alloff()\n"); } void ao () { printf("ao()\n"); } void motor (int m, int p) { printf("motor(%d) at %d\n",m,p); } void beep () { printf("beep()\n"); } void beeper_on () { printf("beeper_on()\n"); } void beeper_off () { printf("beeper_off()\n"); } void set_beeper_pitch (float freq) { printf("set_beeper_pitch(%f)\n",freq); } int analog (int port) { int irandom; irandom = random(256); printf("check analog(%d): answer is %d\n",port,irandom); return irandom; } int random (int max) { #define RAND_MAX 32767 extern int rand(void); int i, irand; irand = rand(); for (i=0; i