This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PROBLEM WITH LCDDATA FUNCTION

I AM NOT GIVING THE WHOLE CODE BUT IT IS JUST A QUERY THAT WHEN I WANT TO TAKE THE DATA IN THE LCD THROUGH THE FUNCTION

void lcddata(char value)
{ 1data=value //where "1data" i have defined earlier as " sfr 1data = 0xa0" rs=1; rw=0; en=1; delay(1); en=0);

now in the code there is
"lcddata(x + 0x30);"

what does this above line mean to me .why x is added to 0x30?????

  • First off - do you _really_ have a variable named "1data"?

    Second - you want to print characters on the display. But your numbers in the program isn't ASCII? So what could then 0x30 represent in the ASCII table?

    This is an example of the problems with magic numbers - they aren't always obvious and so costs time/money/...