<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25588/how-to-print-to-lcd-screen-on-mcb2300-eval-board</link><description> 
Hi I am new to keil&amp;#39;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.</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/thread/136132?ContentTypeID=1</link><pubDate>Wed, 05 May 2010 16:52:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:94f4df61-8a91-4638-9433-9fac309c09d1</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Just an addendum - this world would need a lot fewer security
updates if people learned to use snprintf() when it is available,
instead of the older sprintf() function.&lt;/p&gt;

&lt;p&gt;
It doesn&amp;#39;t matter if it is school work or critical software - how
long do you think it will take you to find the bug when a buffer
overflow in a sprintf() call results in one or more other variables
getting magically changed just because they happen to be stored
directly after the text buffer in memory?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/thread/126151?ContentTypeID=1</link><pubDate>Wed, 05 May 2010 16:32:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4585af73-7f25-4fe7-ba36-969170607737</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Have you checked the manual?&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/man/docs/armlib/armlib_cihfffbc.htm"&gt;http://www.keil.com/support/man/docs/armlib/armlib_cihfffbc.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
You do not snprintf() the value to the display. You snprintf() the
value into a text variable - an array of characters. That text string
may then be sent to the display.&lt;/p&gt;

&lt;p&gt;
It is of course possible to write a mydisplay_printf() that will
create formatted output and directly send it to the display. But
leave that as a later step. First learn how to produce a text string,
and how to send a text string to the display.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/thread/115736?ContentTypeID=1</link><pubDate>Wed, 05 May 2010 15:07:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ad672c65-0459-4b3e-b727-7645d9d8e7c4</guid><dc:creator>darren brown</dc:creator><description>&lt;p&gt;&lt;p&gt;
how do i sprintf() the A/D value to the lcd screen though. That is
where I am baffled?&lt;/p&gt;

&lt;p&gt;
Thanks.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/thread/103945?ContentTypeID=1</link><pubDate>Wed, 05 May 2010 14:53:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:430eb40b-27f6-4fd8-ad12-e150dc5ad098</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
So you know how to print, but not how to replace &amp;quot;MCB2300 DEMO&amp;quot;
with &amp;quot;Value: 147&amp;quot;?&lt;/p&gt;

&lt;p&gt;
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 &amp;quot;MCB2300 DEMO&amp;quot; text.&lt;/p&gt;

&lt;p&gt;
Another alternative is to manually build the text string.
Something like:&lt;/p&gt;

&lt;pre&gt;
...
my_string[FIRST_DIGIT_POSITION] = &amp;#39;0&amp;#39; + value / 1000;
my_string[FIRST_DECIMAL_POSITION] = &amp;#39;0&amp;#39; + (value / 100) % 10;
my_string[FIRST_DECIMAL_POSITION+1] = &amp;#39;0&amp;#39; + (value / 10) % 10;
my_string[FIRST_DECIMAL_POSITION+2] = &amp;#39;0&amp;#39; + value % 10;
...
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/thread/78301?ContentTypeID=1</link><pubDate>Wed, 05 May 2010 14:30:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7a94b504-843f-4835-8abc-112cb81f370c</guid><dc:creator>darren brown</dc:creator><description>&lt;p&gt;&lt;p&gt;
I just do not know how to print the A/D value to the lcd display
on the top line.&lt;/p&gt;

&lt;p&gt;
In the blinky demo i can see the lcd_print (&amp;quot; MCB2300 DEMO &amp;quot;);&lt;/p&gt;

&lt;p&gt;
however i want to print the A/D value from the potentiometer on
the top line.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to print to lcd screen on mcb2300 eval board</title><link>https://community.arm.com/thread/58141?ContentTypeID=1</link><pubDate>Wed, 05 May 2010 14:25:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d64f50e3-01f8-48c4-bfbe-02eec25891fb</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Where are you stuck?&lt;/p&gt;

&lt;p&gt;
Directing text to the top line of the display?&lt;/p&gt;

&lt;p&gt;
Creating the text to display?&lt;/p&gt;

&lt;p&gt;
Getting access to the value that should be presented in the
text?&lt;/p&gt;

&lt;p&gt;
Anywhere else?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>