Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Displaying numbers on LCD using microcontroller

Status
Not open for further replies.

91divine

Junior Member level 3
Joined
Jun 12, 2012
Messages
28
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Netherlands
Activity points
1,488
I am having trouble with displaying numbers on LCD, when i am displaying (say 5) its showing it correctly.
But when i am trying to display (say 432 its displaying some random symbol.

Please help me in this thing as it is the final part of my project,which involve sensor interface through PIC-ADC and display the results in desired range.
I am using PIC18f452. Code in C are required.

Thank you
 

I am having trouble with displaying numbers on LCD, when i am displaying (say 5) its showing it correctly.
But when i am trying to display (say 432 its displaying some random symbol.

Can you post the code you are using in the above example you've given?

Please use CODE or SYNTAX tags.


BigDog
 

I am having trouble with displaying numbers on LCD, when i am displaying (say 5) its showing it correctly.
But when i am trying to display (say 432 its displaying some random symbol.

Please help me in this thing as it is the final part of my project,which involve sensor interface through PIC-ADC and display the results in desired range.
I am using PIC18f452. Code in C are required.

Thank you

As it is alphanumeric display so you have to separate each digit and then send ASCII values of those digits, then it will work.
 

you have to send ascii value of each number one by one then and then it will display the whole number.
for seperation of digit from whole number say 247 then do division by 10 and module by 10 to get separate each digit then send their ascii value to lcd.

hope this will help you
 

Code:
//display function

void lcd_number_display(unsigned int adc)
{
 unsigned char a[5]={0,0,0,0,0},cnt=0;   
if(adc==0) { cnt=1; }


    while(adc)
      {
		a[cnt++]=(adc%10);
		adc=(adc/10);
      }

     while(cnt--)
     {
       lcd_data((a[cnt]+'0'));    //your single character display  LCD function    [ +'0' means  add ascii offset value for display ]
     }
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top