<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Writing and re-writing text?]]></title><description><![CDATA[<p dir="auto">I'm trying to create a text area on the screen where I can write some text (like a sensor value) and then periodically replace this with new text somehow.  I can't find anything about how to do common operations like this.  How do I erase the prior value and replace it with the new value?  thanks</p>
]]></description><link>https://community.m5stack.com/topic/4180/writing-and-re-writing-text</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 04:47:43 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4180.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Apr 2022 13:55:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Writing and re-writing text? on Thu, 07 Apr 2022 13:53:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/macsbug" aria-label="Profile: macsbug">@<bdi>macsbug</bdi></a>  Thank you!</p>
]]></description><link>https://community.m5stack.com/post/17124</link><guid isPermaLink="true">https://community.m5stack.com/post/17124</guid><dc:creator><![CDATA[david-bethesda]]></dc:creator><pubDate>Thu, 07 Apr 2022 13:53:12 GMT</pubDate></item><item><title><![CDATA[Reply to Writing and re-writing text? on Wed, 06 Apr 2022 02:44:02 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/david-bethesda" aria-label="Profile: david-bethesda">@<bdi>david-bethesda</bdi></a></p>
<p dir="auto">Use "backgroundcolor"</p>
<p dir="auto">setTextColor(uint16_t color, uint16_t backgroundcolor);<br />
m5-docs/docs/en/api/lcd.md<br />
<a href="https://github.com/m5stack/m5-docs/blob/master/docs/en/api/lcd.md" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/m5-docs/blob/master/docs/en/api/lcd.md</a></p>
<p dir="auto">#include &lt;M5Stack.h&gt;<br />
void setup() {<br />
M5.begin();<br />
M5.Lcd.setTextSize(2);</p>
<p dir="auto">// Numerical Value<br />
M5.Lcd.setCursor(5, 10);<br />
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);<br />
M5.Lcd.println(123456.78);<br />
M5.Lcd.setCursor(5, 10);<br />
M5.Lcd.println("         ");  // "........."<br />
M5.Lcd.setCursor(5, 10);<br />
M5.Lcd.println(1.41);</p>
<p dir="auto">// Stirng<br />
M5.Lcd.setCursor(5, 50);<br />
M5.Lcd.println("987654.32");<br />
M5.Lcd.setCursor(5, 50);<br />
M5.Lcd.println("         ");  // "........."<br />
M5.Lcd.setCursor(5, 50);<br />
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);<br />
M5.Lcd.println("3.14");</p>
<p dir="auto">}</p>
<p dir="auto">void loop() {</p>
<p dir="auto">}</p>
<p dir="auto">If there is no background color<br />
<img src="/assets/uploads/files/1649211602135-t1.png" alt="0_1649211605482_t1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">If there is a background color<br />
<img src="/assets/uploads/files/1649211642320-t2.png" alt="0_1649211646347_t2.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/17105</link><guid isPermaLink="true">https://community.m5stack.com/post/17105</guid><dc:creator><![CDATA[macsbug]]></dc:creator><pubDate>Wed, 06 Apr 2022 02:44:02 GMT</pubDate></item><item><title><![CDATA[Reply to Writing and re-writing text? on Wed, 06 Apr 2022 00:34:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/agreedk" aria-label="Profile: agreedk">@<bdi>agreedk</bdi></a> thanks!  I guess that means I have to figure out how tall a font is in pixels, and how wide the phrase is, ugh.  Feels very imprecise and clunky.</p>
]]></description><link>https://community.m5stack.com/post/17104</link><guid isPermaLink="true">https://community.m5stack.com/post/17104</guid><dc:creator><![CDATA[david-bethesda]]></dc:creator><pubDate>Wed, 06 Apr 2022 00:34:01 GMT</pubDate></item><item><title><![CDATA[Reply to Writing and re-writing text? on Tue, 05 Apr 2022 17:09:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/david-bethesda" aria-label="Profile: david-bethesda">@<bdi>david-bethesda</bdi></a> you select where to write the text, x &amp; y, then make a function to first erase the area with fill rect and then write the new text at x,y</p>
]]></description><link>https://community.m5stack.com/post/17101</link><guid isPermaLink="true">https://community.m5stack.com/post/17101</guid><dc:creator><![CDATA[AgreeDK]]></dc:creator><pubDate>Tue, 05 Apr 2022 17:09:20 GMT</pubDate></item><item><title><![CDATA[Reply to Writing and re-writing text? on Tue, 05 Apr 2022 16:07:13 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> but I'm writing this particular code in C++ /  Arduino so I'm using M5.Lcd</p>
]]></description><link>https://community.m5stack.com/post/17100</link><guid isPermaLink="true">https://community.m5stack.com/post/17100</guid><dc:creator><![CDATA[david-bethesda]]></dc:creator><pubDate>Tue, 05 Apr 2022 16:07:13 GMT</pubDate></item><item><title><![CDATA[Reply to Writing and re-writing text? on Tue, 05 Apr 2022 14:39:41 GMT]]></title><description><![CDATA[<p dir="auto">You can hold use a label to display a sensor value and place it inside a loop so that it will constantly check the sensors reading and update the value.</p>
]]></description><link>https://community.m5stack.com/post/17099</link><guid isPermaLink="true">https://community.m5stack.com/post/17099</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Tue, 05 Apr 2022 14:39:41 GMT</pubDate></item></channel></rss>