Need some help to display a big font clock

Status
Not open for further replies.
I went through those links. But I can't understand what they have done.
https://www.mikroe.com/forum/viewtopic.php?f=13&t=32369

When I check the numbers in a counter it works fine now. Then I tried to display two numbers together. Number 1 prints correctly, when it comes to print number 2 it displays 22. Number 1 also get erased.
 

Zip and post your complete mikroC project files and tell me what you want to display like int or float. I will write a working code for you.
 

you declare your array indexing variables in your coustomChar.h file
char i,j;
global that creating problem try to declare them as local static variables for your zeros,one,two and other functions.
 

I did try that. But doesn't make any difference. Because in every for loop the value of i and j becomes 0
 

Code:
Lcd_Chr(4,16, (seconds / 10)  + 48);     //Print tenss digit of seconds variable
   Lcd_Chr(4,17, (seconds % 10)  + 48);     //Print oness digit of seconds variable


this what you are talking then i think it display normal font on display not big numbers.
 

Nope. I want to display hours and minutes using a big font and seconds using the normal font.
 

ok to do that you can make the string function using any of your zero,one,two any of function.Or you can set your lcd reading update time let us say you update your lcd reading every 1 second.or you can do like

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
main()
{
   static unsigned int h;
 
   h++ //increment in main or separate timing
 
if(h==1)
{
  //display h1;
}
else if(h==2)
{
  //display h2;
}
else if(h==3)
{
  //display s1 min
}
else if(h==4)
{
  //display s2 min
h=0;
}

 

I don't get it. Whats the point of that? I have used a switch statement to display the numbers in the show_time function.
I think the issue is in some LCD command. Do you know what this means?

Code:
Lcd_Chr(pos_row, pos_char, 0) ;

I know it prints a character but why they given it as 0,1,2,.... What does it relate to?
 



my point is you are using switch statement for switching the 0 to 9 digit respective value of your variable not between four digit that why i said you can use string function or method i show.

and for Lcd_Chr(); function display a char to given row and position(column) you give.
https://www.mikroe.com/download/eng/documents/compilers/mikroc/pro/pic/help/lcd_library.htm#lcd_chr
 

my point is you are using switch statement for switching the 0 to 9 digit respective value of your variable not between four digit that why i said you can use string function or method i show.

I'm sorry I don't understand what you are saying.

and for Lcd_Chr(); function display a char to given row and position(column) you give.
https://www.mikroe.com/download/eng/documents/compilers/mikroc/pro/pic/help/lcd_library.htm#lcd_chr
Yeah but what is the meaning of 0? And for the other segment they are using 1. Why is that?

Btw thanks for all the help you are giving
 

Yeah but what is the meaning of 0? And for the other segment they are using 1. Why is that?

means they are the charter you want to print for example

Lcd_Chr(2, 3, '0' ) ; will print number 0 at line 2 and place 3 in lcd.

But if you use Lcd_Chr(2, 3, 0 ) ; print the hex value.
 

yes but I saw your code you are converting it ascii so your date year month display printing fine so its not the Lcd_Cha (); function problem.

Can you attached your simulation output images both for working counter for big font and display two character together.

- - - Updated - - -

you can try this also


Code C - [expand]
1
2
3
4
5
ByteToStr(hour, str) ;
lcd_out(1,1,str);
 
ByteToStr(min, str1) ;
lcd_out(1,4,str1);

 
Last edited:

This is how the counter works



This is what happens when I try to display 1 and aftwards 1 and 2 together - it displays 22
 

Zip and post the latest mikroC project files. I will fix it. Also attach the proteus file. It is needed to test the working.
 
Last edited:

I have attached the Mikroc and Proteus file.
 

Attachments

  • yard.rar
    178.4 KB · Views: 54

You have to find a way to display the time separator. Use 40X4 LCD.
 

Attachments

  • yard.rar
    198.5 KB · Views: 49
  • bigfont.png
    3.9 KB · Views: 59

I can't use a 40x4 LCD. I think its not available in the local market. Also I already have a 20x4 display. Isn't there anything I could do?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…