member_tdh
Member level 5
Hi all members!!!
I'm a new PSoC Designer. I'm Writing in C.
I want to display an Int value (or time clock) on the LCD display.
In the lcd toolbox they only talk about displaying a Hex Value.
Help me!!!
Does anyone have some sample code on how to display a Int value?
my code here but not correct, pls help me :
void main()
{
LCD_1_Init();
LCD_1_Start();
while (1)
{
LCD_1_Position(0,0);
LCD_1_PrCString("Time ");
LCD_1_Position(0,5);
LCD_PrintInt((int)cTime.hour);
LCD_1_Position(0,8);
LCD_PrintInt((int)cTime.min);
LCD_1_Position(0,11);
tmp=(WORD)cTime.sec;
LCD_PrintInt(tmp);
}
}
void LCD_PrintInt(WORD val)
{
char str[6];
itoa(str, val, 10);
LCD_1_PrString(str);
}
I'm a new PSoC Designer. I'm Writing in C.
I want to display an Int value (or time clock) on the LCD display.
In the lcd toolbox they only talk about displaying a Hex Value.
Help me!!!
Does anyone have some sample code on how to display a Int value?
my code here but not correct, pls help me :
void main()
{
LCD_1_Init();
LCD_1_Start();
while (1)
{
LCD_1_Position(0,0);
LCD_1_PrCString("Time ");
LCD_1_Position(0,5);
LCD_PrintInt((int)cTime.hour);
LCD_1_Position(0,8);
LCD_PrintInt((int)cTime.min);
LCD_1_Position(0,11);
tmp=(WORD)cTime.sec;
LCD_PrintInt(tmp);
}
}
void LCD_PrintInt(WORD val)
{
char str[6];
itoa(str, val, 10);
LCD_1_PrString(str);
}