<?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[M5Stack.h: No such file or directory with M5StickCPlus?]]></title><description><![CDATA[<p dir="auto">I am trying to test SPIFFS and display a jpg file using the drawJPGFile method desribed in <a href="https://docs.m5stack.com/en/api/core/lcd:" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/en/api/core/lcd:</a></p>
<p dir="auto">#include &lt;M5Stack.h&gt;<br />
#include &lt;M5StickCPlus.h&gt;<br />
#include &lt;SPIFFS.h&gt;<br />
void setup() {<br />
M5.begin();  //Initialize M5Stack<br />
M5.Lcd.drawJpgFile(SPIFFS, "1.jpg",10,10);<br />
}<br />
void loop(){<br />
}</p>
<p dir="auto">When I compile the above, I get the error "M5Stack.h: No such file or directory". If I try to compile with only M5StickCPlus.h included, I get 'class M5Display' has no member named 'drawJpgFile'.</p>
<p dir="auto">I thought M5StickCPlus.h would include M5Stack.h? (I've never had to include M5Stack.h before in any of my sketches.)</p>
<p dir="auto">Are SPIFFS and drawJpgFile not yet supported on the M5StickCPlus?</p>
<p dir="auto">Is there another way to display images? I suppose I could always make bitmaps and write new code to load them from PROGMEM?</p>
]]></description><link>https://community.m5stack.com/topic/5045/m5stack-h-no-such-file-or-directory-with-m5stickcplus</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 18:01:48 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5045.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Feb 2023 20:22:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Stack.h: No such file or directory with M5StickCPlus? on Thu, 09 Feb 2023 00:37:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/18806">@wsanders</a> At least with respect to the LCD library: The only function implemented so far to manipulate whole images is drawBitmap. drawJpg and drawJpgFile are commented out in <a href="https://github.com/m5stack/M5StickC-Plus/blob/master/src/M5Display.h" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5StickC-Plus/blob/master/src/M5Display.h</a> so I assume they aren't working yet.</p>
<p dir="auto">So my workflow for now is:</p>
<ol>
<li>Save the image from gimp  in gimp's ".h" format. This is smaller than a xpm or bmp. You will get a static char *data structure of all the pixels in the image. The .h file includes a macro to extract the pixels:</li>
</ol>
<p dir="auto">#define HEADER_PIXEL(data,pixel) {<br />
pixel[0] = (((data[0] - 33) &lt;&lt; 2) | ((data[1] - 33) &gt;&gt; 4)); <br />
pixel[1] = ((((data[1] - 33) &amp; 0xF) &lt;&lt; 4) | ((data[2] - 33) &gt;&gt; 2)); <br />
pixel[2] = ((((data[2] - 33) &amp; 0x3) &lt;&lt; 6) | ((data[3] - 33))); <br />
data += 4; <br />
}</p>
<ol start="2">
<li>
<p dir="auto">Write your own function rgb888to565 to compress the pixels into a uint16_t.</p>
</li>
<li>
<p dir="auto">Draw a bitmap of the image as fast as you can:</p>
</li>
</ol>
<p dir="auto">#include &lt;M5StickCPlus.h&gt;<br />
#include "1.h"<br />
int pixel[3];<br />
// pointer fu to preserve the start of .h data<br />
char *datastart;<br />
uint16_t *bitmap;</p>
<p dir="auto">void setup() {<br />
M5.begin();<br />
M5.Lcd.setRotation(3);<br />
bitmap = (uint16_t *)malloc(height * width * 2);<br />
}</p>
<p dir="auto">void loop() {<br />
M5.Lcd.fillScreen(GREEN);<br />
datastart = data;<br />
for (int16_t y=0; y &lt; height; y++) {<br />
for (int16_t x=0; x &lt; width; x++) {<br />
HEADER_PIXEL(data, pixel);<br />
bitmap[60*y + x] = rgb888to565(pixel[0], pixel[1], pixel[2]);<br />
}<br />
}<br />
M5.Lcd.drawBitmap(0,0,width,height,bitmap);<br />
data = datastart;<br />
}</p>
<p dir="auto">Or you can use the Sprite library, which works well.</p>
]]></description><link>https://community.m5stack.com/post/20051</link><guid isPermaLink="true">https://community.m5stack.com/post/20051</guid><dc:creator><![CDATA[wsanders]]></dc:creator><pubDate>Thu, 09 Feb 2023 00:37:40 GMT</pubDate></item></channel></rss>