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

display the adc data register of lpc2138 in lcd display ?

Hi
I have done the analog to digital conversion in lpc2138.the thing is i need to display the digital data in lcd . the adc data will be in hex format (0x1FD) and that will be stored in the data register on adc . in order to display that using character lcd the HEX data has to be converted in to ASCII . i dont know how to do that. coding is done in c using keil tool.

Thanks in advance

Parents
  • Interesting that you write "even that was not working".

    Even what? Your first attempt did add the value zero - and your math book already told you that addition zero to a number isn't expected to do any big magic.

    Your second attempt you added 0x30 - you can write '0' instead unless you find it too readable to use actual characters.

    But the big question is: you say it isn't working. But you don't say what is happening and what you expected to happen.

     a = 0x000003A2;  // = 930 decimal
     b = a%10;        // = 0 decimal
     b = b+0x30;      // = '0'
     a = a/10;        // = 93 decimal
     c = a%10;        // = 3 decimal
     c = c+0x30;      // = '3'
     d = a/10;        // = 9 decimal
     d = d+0x30;      // = '9'
    


    You unhappy with '9' '3' and '0'?

Reply
  • Interesting that you write "even that was not working".

    Even what? Your first attempt did add the value zero - and your math book already told you that addition zero to a number isn't expected to do any big magic.

    Your second attempt you added 0x30 - you can write '0' instead unless you find it too readable to use actual characters.

    But the big question is: you say it isn't working. But you don't say what is happening and what you expected to happen.

     a = 0x000003A2;  // = 930 decimal
     b = a%10;        // = 0 decimal
     b = b+0x30;      // = '0'
     a = a/10;        // = 93 decimal
     c = a%10;        // = 3 decimal
     c = c+0x30;      // = '3'
     d = a/10;        // = 9 decimal
     d = d+0x30;      // = '9'
    


    You unhappy with '9' '3' and '0'?

Children
No data