Im trying to display the output of my MLX90614 sensor on mcufriend tft display. But unable to do so. I can only see the TFT being lit to white color, but no output on TFT. I tried tft-lcd sample codes, which are working fine. I also tried mlx90614 (mlxtext code), which is also working fine.
But I combined the two codes so as to output it on TFT, which doesnt work. Hence I think this code might have some issue.
Im a beginner pls help!!
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
#include <TouchScreen.h>
#include <Wire.h>
#include <Adafruit_MLX90614.h>
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4
#define TS_MINX 122
#define TS_MINY 111
#define TS_MAXX 942
#define TS_MAXY 890
#define YP A3
#define XM A2
#define YM 9
#define XP 8
#define BLACK 0x0000
#define WHITE 0xFFFF
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 364);
boolean buttonEnabled = true;
void setup() {
mlx.begin();
tft.reset();
uint16_t identifier = tft.readID();
tft.begin(identifier);
tft.setRotation(1);
tft.fillScreen(WHITE);
}
void loop() {
tft.setCursor(0,1);
tft.print("Target ");
tft.print(mlx.readObjectTempC());
tft.print(" C");
delay(1000);
}