Microcontroller › 8051 › Calculating flow rate of an infusion pump › Hi, This function will help
May 18, 2014 at 4:26 am
#11739
Participant
Hi,
This function will help you. In this whatever the number you want to display, pass it as a parameter and it will be displayed on LCD.
void DisplayDigit(unsigned int dat)
{
unsigned int temp,i=0, buf[10];
while(dat>=10)
{
buf=dat%10;
dat=dat/10;
i++;
}
buf=dat;
for(temp=0;temp<=i;temp++)
{
LCDWriteData(buf[i-temp]+’0′);
}
}
All the best…!!!