Jump to content



Photo
- - - - -

SetTimer Help


  • Please log in to reply
No replies to this topic

#1 GodOfCows

GodOfCows

    Casio Fan

  • Members
  • PipPip
  • 32 posts

  • Calculators:
    fx-9860gii, fx-9750gii

Posted 07 August 2018 - 07:14 PM

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;
}





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users