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

how to print to lcd screen on mcb2300 eval board

Hi I am new to keil's uvision software, and as such have been trying to work through the demo programs from keil.

The problem I am having is that I want to display the A/D value of the potentiometer on the lcd screen on the mcb 2300 eval board. I have downloaded the blinky demo program from keil, and I can kinda see how the bar graph is displayed. But I am struggling to understand how to put the voltage on the top line of the lcd screen. I could really do with some help on this.

I have managed to use the ADC demo program to display a temp value on the uart output 2. Can I simply add this file to the blinky program and somehow print the value to the lcd screen?

Any assistance would be gratefully received.

Many thanks from a frustrated beginner.

Parents
  • So you know how to print, but not how to replace "MCB2300 DEMO" with "Value: 147"?

    One alternative is to use sprintf() (or the much safer snprintf() for all platforms where it is available to avoid problems with buffer overflows) to print into a character array and then print this character array instead of the "MCB2300 DEMO" text.

    Another alternative is to manually build the text string. Something like:

    ...
    my_string[FIRST_DIGIT_POSITION] = '0' + value / 1000;
    my_string[FIRST_DECIMAL_POSITION] = '0' + (value / 100) % 10;
    my_string[FIRST_DECIMAL_POSITION+1] = '0' + (value / 10) % 10;
    my_string[FIRST_DECIMAL_POSITION+2] = '0' + value % 10;
    ...
    

Reply
  • So you know how to print, but not how to replace "MCB2300 DEMO" with "Value: 147"?

    One alternative is to use sprintf() (or the much safer snprintf() for all platforms where it is available to avoid problems with buffer overflows) to print into a character array and then print this character array instead of the "MCB2300 DEMO" text.

    Another alternative is to manually build the text string. Something like:

    ...
    my_string[FIRST_DIGIT_POSITION] = '0' + value / 1000;
    my_string[FIRST_DECIMAL_POSITION] = '0' + (value / 100) % 10;
    my_string[FIRST_DECIMAL_POSITION+1] = '0' + (value / 10) % 10;
    my_string[FIRST_DECIMAL_POSITION+2] = '0' + value % 10;
    ...
    

Children