<?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[Double buffer in m5stickC]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I want to draw an image in m5stickC using Arduino IDE, but the image non-stop flash in screen.</p>
<p dir="auto">void loop() {<br />
// Change the sprite position<br />
x = ...<br />
y = ...</p>
<p dir="auto">// Clear screen<br />
M5.Lcd.fillScreen(WHITE);</p>
<p dir="auto">// Redraw image to new location<br />
M5.Lcd.drawBitmap(x, y, w, h,(uint16_t *)img, 0xffff);<br />
}</p>
<p dir="auto">Does m5stickC provide similiar functions / demo code:</p>
<ol>
<li>double buffer</li>
<li>next frame checking --- lcd/cpu trigger to redraw</li>
</ol>
<p dir="auto">Thanks<br />
Guy</p>
]]></description><link>https://community.m5stack.com/topic/1480/double-buffer-in-m5stickc</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 08:43:58 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1480.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Nov 2019 15:38:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Double buffer in m5stickC on Mon, 13 Jan 2020 23:17:12 GMT]]></title><description><![CDATA[<p dir="auto">You need to look at using sprites to avoid the flickering / flashing when you blank the screen. Take a look at the example sprite projects to see how it's done. The M5.Lcd functions can be called on a sprite object, so bitmap drawing, text drawing etc can be done the same way. Clearing, and drawing the sprite happens off screen, and then is copied quickly to the screen with pushSprite() which avoids visible flashing. The examples provided show you how to do it all, but here's the basic process :</p>
<ol>
<li>
<p dir="auto">create your sprite object<br />
TFT_eSprite tftSprite = TFT_eSprite(&amp;M5.Lcd);</p>
</li>
<li>
<p dir="auto">create a sprite and give it the size<br />
tftSprite.createSprite(160, 80);</p>
</li>
<li>
<p dir="auto">clear the sprite<br />
tftSprite.fillSprite(WHITE);</p>
</li>
<li>
<p dir="auto">draw into the sprite<br />
tftSprite.drawBitmap(x, y, w, h,(uint16_t *)img, 0xffff);</p>
</li>
<li>
<p dir="auto">copy the sprite to the screen, and let it know where to draw it<br />
tftSprite.pushSprite(0, 0);</p>
</li>
</ol>
]]></description><link>https://community.m5stack.com/post/7028</link><guid isPermaLink="true">https://community.m5stack.com/post/7028</guid><dc:creator><![CDATA[Maxrom]]></dc:creator><pubDate>Mon, 13 Jan 2020 23:17:12 GMT</pubDate></item></channel></rss>