cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in displaying a number on char LCD displays

Arman Ilmak
Senior
Posted on May 01, 2018 at 12:39

Hi.

I was working with my new stm8s105 MCU trying to get started with the timers.

But every time I use the command to display the time on the LCD the same number showed every time.I thought that the problem is my timer code but when I just put a number on the LCD to show it just showed an irrelevant number.

I use the same LCD.h on LPC1768 and STM32F2 and just converted the same header.The only difference is that I used Keil compiler for them and now I'm using IAR.

lcd_gotoxy(1,2);

sprintf(buf,'%d',100);

lcd_print(buf);

delay_ms(1000);

This is a simple code that must show 100 but it displays 12594

>:(

The characters are displayed properly.The problem is numbers.

13 REPLIES 13
Posted on May 01, 2018 at 19:27

I don't know why does this message 'declared implicitly' is shown in the message box and I don't know what is it at all.

When I use this header in stm32f no such warning appears!!

Is it the problem?

Posted on May 01, 2018 at 19:37

Thank you very much.

I just thought that the warnings are not important.

I searched this warning and as you said that I have to include string.h but I just had to include stdio.h.And that warning disappeared and it worked.

Thanks

Posted on May 01, 2018 at 21:45

Yes.My problem is fixed using stdio.h.

Thanks

Posted on May 01, 2018 at 21:55

Sometimes it take time when you do not see all Warnings from the console. I usually clear all Warnings before I test the software.

Thanks for letting me know!