<?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[Multiple errors when using &lt;M5GFX.h&gt; and MM5Stack.h&gt; in same program]]></title><description><![CDATA[<p dir="auto">Hey all - sounds like a daft question but does anyone know if it is not possible to use both the M5Stack.h and M5GFX.h libraries in the same code please?</p>
<p dir="auto">I am simply starting to write code that plots a graph of temp from the ENVIII sensor.  The factory code for this uses the M5Env and M5Stack libraries, and I want to also use the M5GFX library to plot data to the screen.  However, when I add the M5Stack library to the code - and without changing anything else in the code at all - I get multiple errors upon compile. Now, I can post the code, but I have literally just started writing it and there's <strong>loads</strong> to do before I end up with the final version, so there's much not even penned as yet however it appears I have hit a hurdle at the very start.</p>
<p dir="auto">Simply adding #include &lt;M5Stack.h&gt; to this code created many many errors...</p>
<p dir="auto">#include &lt;M5GFX.h&gt;<br />
#include "M5_ENV.h"<br />
#include &lt;M5Stack.h&gt;</p>
<p dir="auto">M5GFX tft;<br />
SHT3X sht30;</p>
<p dir="auto">float tempC = 0.0;<br />
float tempF = 0.0;<br />
float hum = 0.0;</p>
<p dir="auto">void setup(void) {<br />
Wire.begin();<br />
M5.Power.begin();<br />
tft.init();<br />
tft.setTextDatum(textdatum_t::middle_center);<br />
tft.drawString("Temp Plot Test", tft.width() / 2, 20, 4);<br />
tft.drawLine(10, 10, 10, 100);<br />
}</p>
<p dir="auto">void loop(void) {<br />
tft.drawCircle(100, 100, sht30.cTemp, TFT_YELLOW);<br />
tft.println(sht30.cTemp);<br />
}</p>
]]></description><link>https://community.m5stack.com/topic/5178/multiple-errors-when-using-m5gfx-h-and-mm5stack-h-in-same-program</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 00:08:44 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5178.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Apr 2023 07:07:48 GMT</pubDate><ttl>60</ttl></channel></rss>