Getting this code to work on a Ard Mega

So I bought an AMG8833 and I followed this code that someone was able to make to make it efficient. If I run the code and check the serial monitor, the code is fine. It compiles and runs with the data showing up in the monitor!

My issue is, he made this using parts im not using. I’m using an Arduino Mega and a different TFT screen. My issue is getting the screen to work.

I basically just receive a white screen on upload.

I have tested that the mega and tft screen work by plugging it straight into the board. Then I unplugged it and wired it as a breakout. The test still works so I have the wiring correct.

Now I figured it would be as easy as looking for the initiation of the TFT and swapping the definitions of the variables. I scrolled to the top of the program and see the definition of TFT_CS, TFT_DC, and TFT_RST.

I follow the wiring from the shields ports on, “CS, RS, RST”. Defining them as such does not provide me with anything more than a successful compile, working camera in monitor, but a white screen on display.

My theory is that somehow I have to find where to redefine the MOSI and MISO, because i know that’s needed for SPI data transfer. The source code does not contain a definition for MOSI or MISO pinout, and i cannot find it in the libraries either.

I am decent with C++ itself, but a beginner with arduinos. I actually spent the last FIVE hours (call my foolish if you want) trying to sift through the main libraries to understand the code enough to rewrite a basic version and just define the pinouts myself. This… was a failure, unfortunately.

So can anyone guide me on what changes I need to make to the source code OR a library in order to get it to correctly understand what pins my TFT is on to get passed the white screen?

thermal_cam.ino (91.7 KB)

SPI pins are fixed in hardware, you can't assign the SPI function to other pins.

Well how can I figure out the pinout for a mega for this application in particular? I stress that it's the components of the actual Arduino that I have limited understanding on. I've read materials best I can but I still struggle a bit.

All the Arduino pinouts are documented on their product page on this site.

Right. It that just gives me 50, 51, 52, 53 which is how I have it already. Does this mean there's something else wrong giving me a white screen? Like a case of code issues or something that can't transfer because unos and megas are too different.

SS (slave select) pin is software assigned. Make sure you choose the right pin for that in your sketch.