I'm trying to use the SetTimer function but I'm having trouble getting it to work. I've written a simple program to try out the function:
Any advice would be nice.
#include "fxlib.h" #include "stdio.h" void printnum(short, short, unsigned int); void increase(); void printnum(short x, short y, unsigned int num) { char string[20]; sprintf(&string, "%d", num); PrintXY(x,y,string,0); Bdisp_PutDisp_DD(); } void increase() { static int i = 0; Bdisp_AllClr_DDVRAM(); i++; if (i > 100) KillTimer(1); printnum(0,0,i); } int AddIn_main(int isAppli, unsigned short OptionNum) { unsigned int key, i; Bdisp_AllClr_DDVRAM(); SetTimer(1,500,increase); while(1){ GetKey(&key); } return 1; }