<?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[Drawing random PNG images from SD problem]]></title><description><![CDATA[<p dir="auto">How do i get this code to work<br />
this works :<br />
M5.Lcd.drawPngFile(SD,"/Image8.PNG", 0, 0); // display splash screen<br />
but<br />
M5.Lcd.drawPngFile(SD,PngName, 0, 0); // display splash screen<br />
does not in code below.<br />
I want to generate a random slide show</p>
<pre><code>   int Arand=random(11);
  String PngName="/Image"+ String (Arand)+".PNG";
  Serial.println (PngName);
   M5.Lcd.drawPngFile(SD,(PngName), 0, 0); // display splash screen
</code></pre>
]]></description><link>https://community.m5stack.com/topic/2772/drawing-random-png-images-from-sd-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 03:11:17 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2772.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Jan 2021 13:32:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drawing random PNG images from SD problem on Mon, 18 Jan 2021 17:43:57 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/andyt" aria-label="Profile: AndyT">@<bdi>AndyT</bdi></a></p>
<p dir="auto">you are welcome. Glad to hear it works now.</p>
<p dir="auto">Cheers<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/11851</link><guid isPermaLink="true">https://community.m5stack.com/post/11851</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 18 Jan 2021 17:43:57 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing random PNG images from SD problem on Mon, 18 Jan 2021 17:40:16 GMT]]></title><description><![CDATA[<p dir="auto">Cheers Felix,<br />
No it did not compile without errors before. But  adding .c.str() solved it .<br />
Thank you again</p>
]]></description><link>https://community.m5stack.com/post/11850</link><guid isPermaLink="true">https://community.m5stack.com/post/11850</guid><dc:creator><![CDATA[AndyT]]></dc:creator><pubDate>Mon, 18 Jan 2021 17:40:16 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing random PNG images from SD problem on Mon, 18 Jan 2021 13:45:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/andyt" aria-label="Profile: AndyT">@<bdi>AndyT</bdi></a></p>
<p dir="auto">AFAIK <code>drawPngFile()</code> expects a pointer to a character array as path name and not a String. Just curious, does your code compile w/o error?</p>
<p dir="auto">I think something like this should work:</p>
<pre><code>M5.Lcd.drawPngFile(SD, PngName.c_str(), 0, 0);
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/11829</link><guid isPermaLink="true">https://community.m5stack.com/post/11829</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 18 Jan 2021 13:45:40 GMT</pubDate></item></channel></rss>