Microcontroller › 8051 › Want Help about coding the 16*2 interfacing to lcd for sending the numeric data › Hi Awais,I can give you some
July 8, 2014 at 5:07 am
#11876
AJISH ALFRED
Participant
Hi Awais,
I can give you some clues regarding the logic used,
These two lines are the key,
num[k]=i%10;
This will store the value in the unit place of 'i' to 'k' the variable in 'num'
For example if i = 1234, the value of num [k] will be '4'.
Since to diaplay a value like '4' in the lcd we need to convert it to its ascii value first, the following statement does the same,
c=num[p]+48;
Remember ’48’ is the ascii value of ‘0’. (zero)