First post here and apologies if it’s in the wrong place.
I came across this CO2 monitor project:
I ordered the sensor, tacked it onto an ESP32 and used the basic code offered on the link above (I’m an old hardware / electronics tech, not a coder) to integrate the sensor into my Home Assistant setup using ESPHome and everything is working fine.
However, I would also like to build another using the LilyGO TTGO T-Display ESP32 (built in display) as shown in the link and using the stock code that comes with the kit version but understand the code is setup for PlatformIO and I have no experience of that IDE.
Or didn’t till this morning as I now have it all installed and have managed to install some simple code (Arduino Blink) to an ESP32 and that is also working fine.
So my question is how should / would / could I correctly make use of the code seen here please?:
I’ve tried opening the local folder (assuming it’s already in PlatformIO format) and that seems to work but I get errors when I try to compile so I’m probably doing it wrong?
Ok, I think I might have got a bit further as I read elsewhere to try ‘Import Arduino’ rather than open and it seems to have worked to some degree (the code then uploaded to a generic ESP32 etc). I can’t tell if it worked fully as I don’t have the screen but I am confused why if it was in Arduino IDE format why the Arduino IDE didn’t work in the first place and why the mention of PlatformIO IDE?
Now I just need to wait for the parts to arrive and see how / where I configure the WiFi settings etc.
No, the build system is PlatformIO. The code is written against the Arduino API (Arduino.h) and the used libraries (most importantly TFT_eSPI.h). That’s what matters most here when you port it to a different board target as you have to understand how to interact with these libraries different (or give them different setup information) for your differing board.
The project uses the TFT_eSPI library with a specific configuration in terms of where the display is connected (and the featureset of the library).
The pins (SPI bus, MISO/MOSI/SCLK,CS)and display driver (ST7789 in the reference) and geometry (width + heigh) differ from display to display / board to board depending on how it’s internally or externally connected.
A first sensible step is to set up a minimal TFT_eSPI project for your LilyGO TTGO T-Display in PlatformIO with correct pin information. See