Thermal Camera Code Issues

I found this amazing DIY tutorial for an $80 thermal camera on YouTube. I bought the exact same parts featured in the video and followed the wiring exactly as shown in the video. I was able to get the camera to boot up and the sensor works but the code needs to be modified in order to work. I contacted the creator of the video, he seems to think part of the problem is that I need to recalibrate the screen (which was not mentioned in the video). I have no coding experience, and now I’m over $100 into this project because I bought another screen thinking that this was the issue initially. I really want to get this to work as I have also designed and printed a case for it so I’m willing to compensate someone if needed to get this to work. I have a short clip here to show you the issue I have with it.

I have attached the code file to this post.

And here are some errors that Arduino software displayed when uploading the code onto teensy 3.2 even though it compiled and uploaded.

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\UTouch-master/UTouch.h:38:0,
                 from C:\Users\coffe\Desktop\ThermalCamera\ThermalCamera.ino:45:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\UTouch-master/hardware/arm/HW_ARM_defines.h:9:0: warning: "swap" redefined
 #define swap(type, i, j) {type t = i; i = j; j = t;}
 ^
In file included from C:\Users\coffe\Desktop\ThermalCamera\ThermalCamera.ino:39:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h:557:0: note: this is the location of the previous definition
 #define swap(a, b) { typeof(a) t = a; a = b; b = t; }
 ^
C:\Users\coffe\Documents\Arduino\libraries\Adafruit_AMG88xx-master\Adafruit_AMG88xx.cpp: In member function 'void Adafruit_AMG88xx::read(uint8_t, uint8_t*, uint8_t)':
C:\Users\coffe\Documents\Arduino\libraries\Adafruit_AMG88xx-master\Adafruit_AMG88xx.cpp:225:11: warning: unused variable 'value' [-Wunused-variable]
   uint8_t value;
           ^

Thanks in advance!

ThermalCamera.ino (22.2 KB)

I suggest you ask a moderator to move this to the "Gigs and Collaborations" forum, also FYI code that is too long to post should be added as an attachment, not linked from an external site.

aarg:
I suggest you ask a moderator to move this to the "Gigs and Collaborations" forum, also FYI code that is too long to post should be added as an attachment, not linked from an external site.

Oh, I see, thank you, I will do that. If a moderator sees this please move this to Gigs and Collaborations, thanks.

It's the little "Report to moderator" in blue letters below that...

The posted error messages tell you that two different modules use the same name "swap" for two slightly different functions.

Change the name of one of them, everywhere it appears in that module.

jremington:
The posted error messages tell you that two different modules use the same name "swap" for two slightly different functions.

Change the name of one of them, everywhere it appears in that module.

You think this is what's causing my issues?

Error messages don't lie.

jremington:
Error messages don't lie.

Haha true. Do I need to modify my source file or the included libraries?

coffeeowl88:
And here are some errors that Arduino software displayed when uploading the code onto teensy 3.2 even though it compiled and uploaded.

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\UTouch-master/UTouch.h:38:0,

from C:\Users\coffe\Desktop\ThermalCamera\ThermalCamera.ino:45:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\UTouch-master/hardware/arm/HW_ARM_defines.h:9:0: warning: "swap" redefined
#define swap(type, i, j) {type t = i; i = j; j = t;}
^
In file included from C:\Users\coffe\Desktop\ThermalCamera\ThermalCamera.ino:39:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h:557:0: note: this is the location of the previous definition
#define swap(a, b) { typeof(a) t = a; a = b; b = t; }
^
C:\Users\coffe\Documents\Arduino\libraries\Adafruit_AMG88xx-master\Adafruit_AMG88xx.cpp: In member function 'void Adafruit_AMG88xx::read(uint8_t, uint8_t*, uint8_t)':
C:\Users\coffe\Documents\Arduino\libraries\Adafruit_AMG88xx-master\Adafruit_AMG88xx.cpp:225:11: warning: unused variable 'value' [-Wunused-variable]
  uint8_t value;
          ^

Strange...I downloaded the libraries used and copied your sketch to a new one and I did not get any error when I compiled it! :o

Wow that really is weird. Any idea what it could be? Do I have libraries I don't need or something? Also are you sure you didn't get any errors because it does compile for me and upload but when you scroll up in the console box it shows me the errors.

I'd be a little suspicious of the errors. They both come from the teensy libraries. Also, the error looks to me like a swapping issue. Like the position in one axis is getting reversed. Is there a possibility of getting new versions of these libraries from the IDE library manager?

-jim lee