<?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[old text line visible under new one]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">Please excuse the title, which probably does not give much. But I did not know how to describe my problem differently...</p>
<p dir="auto">I have with some help put together a script that displays data from my inverter. Depending on whether energy is being fed into the grid or drawn from the grid, the line of text changes. The text for drawing is shorter than the text for feeding. Now you can see "remnants" of the overshifted line.</p>
<p dir="auto">I upload a screenshot, a picture is worth 1000 words.<br />
<img src="/assets/uploads/files/1678547192212-2023-03-11_15h58_52.png" alt="0_1678547183541_2023-03-11_15h58_52.png" class=" img-fluid img-markdown" /><br />
The problem also affects the other lines if the new values are smaller than the previous ones.</p>
<p dir="auto">The code I use:</p>
<pre><code># Endlosschleife zum Anzeigen der Leistungsdaten
lcd.clear(lcd.BLACK)
while True:
    # Leistungsdaten abrufen
    data = get_fronius_data(FRONIUS_IP)
    
    # Neue Leistungsdaten speichern
    pv_leistung = data["Site"]["P_PV"]
    verbrauch = data["Site"]["P_Load"]
    p_grid = data["Site"]["P_Grid"]

    # Nur die aktualisierten Werte auf dem Bildschirm anzeigen
    lcd.print("PV Leistung: {:.2f} kW".format(pv_leistung/1000), lcd.CENTER, 50, lcd.WHITE)
    lcd.print("Verbrauch: {:.2f} kW".format(verbrauch/1000), lcd.CENTER, 100, lcd.WHITE)
    
    # Textfarbe basierend auf dem Vorzeichen von p_grid setzen
    if p_grid &lt; 0:
        lcd.print("Einspeisung: {:.2f} kW".format(-p_grid/1000), lcd.CENTER, 150, lcd.GREEN)
    else:
        lcd.print("Bezug: {:.2f} kW".format(p_grid/1000), lcd.CENTER, 150, lcd.RED)
    
    # Kurze Pause einlegen
    utime.sleep(2)
</code></pre>
<p dir="auto">How can I change this so that this problem does not occur?</p>
<p dir="auto">thx!</p>
]]></description><link>https://community.m5stack.com/topic/5120/old-text-line-visible-under-new-one</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 08:10:13 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5120.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 Mar 2023 15:07:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to old text line visible under new one on Sun, 12 Mar 2023 13:41:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello@margel</p>
<p dir="auto">The description in m5-docs is done with setTextColor.</p>
<p dir="auto"><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><br />
setTextColor( color, backgroundcolor )</p>
]]></description><link>https://community.m5stack.com/post/20314</link><guid isPermaLink="true">https://community.m5stack.com/post/20314</guid><dc:creator><![CDATA[macsbug]]></dc:creator><pubDate>Sun, 12 Mar 2023 13:41:03 GMT</pubDate></item><item><title><![CDATA[Reply to old text line visible under new one on Sun, 12 Mar 2023 09:17:30 GMT]]></title><description><![CDATA[<p dir="auto">I think I have already tried that. Then I have the "problem" that the screen seems to flicker. So all text disappears for half a second and then the image is rebuilt. This is very "unpleasant" to watch.</p>
]]></description><link>https://community.m5stack.com/post/20313</link><guid isPermaLink="true">https://community.m5stack.com/post/20313</guid><dc:creator><![CDATA[margel]]></dc:creator><pubDate>Sun, 12 Mar 2023 09:17:30 GMT</pubDate></item><item><title><![CDATA[Reply to old text line visible under new one on Sat, 11 Mar 2023 21:17:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/36609">@margel</a> the display does not refresh when new text appears and this requires a black “blanking” background.</p>
]]></description><link>https://community.m5stack.com/post/20302</link><guid isPermaLink="true">https://community.m5stack.com/post/20302</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Sat, 11 Mar 2023 21:17:28 GMT</pubDate></item></channel></rss>