Buenas noches requiero de su ayuda, tengo un codigo, con dos problemas, en este codigo tengo dos sensores DS18B20 quisiera implementar que en el momento que falle el sensor primario entrara en funcionamiento el sensor secundario y siga mandando la señal de temperatura el siguiente problema es que la temperatura se muestra en diferentes colores si es menor de 20 la temperatura en grados C es color blanco si es entre 20 y 30 color del a temperatura en grados C es amarillo y mayor de 30 grados C color rojo , la cuestion es que cuando cambio a grados F, aplica el mismo criterio y requiero que en grados F, los valores sean los equivalentes es decir menos de 68 grados F color blanco, entre 68 y 86 grados F color amarillo y mayor de 86 rojo, espero algun alma me mueda ayudar de antemano muchas gracias, saludos. El codigo es el siguiente:
#include <Adafruit_GFX.h>
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft; // create display object
#include <TouchScreen.h>
// used to control/check if units should be displayed in C or F (makes code more readable)
#define degC false
#define degF true
// Control sensor de temperatura DS20B18
#include <OneWire.h>
#include <DallasTemperature.h>
// El cable de datos está conectado al puerto 53 del Arduino
#define ONE_WIRE_BUS_1 53
#define TEMPERATURE_PRECISION 10
// Configure una instancia de oneWire para comunicarse con cualquier dispositivo OneWire
OneWire oneWire1(ONE_WIRE_BUS_1);
// Pase nuestra referencia de oneWire a la temperatura de Dallas.
DallasTemperature sensors1(&oneWire1);
// Matrices para contener direcciones de dispositivos
DeviceAddress TempControllerP, TempControllerS;
// Crear dos botones de pantalla táctil
Adafruit_GFX_Button degC_btn;
Adafruit_GFX_Button degF_btn;
#include <Fonts/FreeSerif9pt7b.h> // when you want other fonts
#include <Fonts/FreeSans9pt7b.h> // when you want other fonts
#include <Fonts/FreeSans12pt7b.h> // when you want other fonts
#include <FreeDefaultFonts.h> // when you want other fonts
#include <Fonts/FreeSerif12pt7b.h>
#include <FreeSerif12pt7b.h>
#define MINPRESSURE 10
#define MAXPRESSURE 1000
#define TS_MINX 130
#define TS_MAXX 905
#define TS_MINY 75
#define TS_MAXY 930
#define YP A2 // Debe ser un pin analógico, ¡use la notación "An"!
#define XM A3 // Debe ser un pin analógico, ¡use la notación "An"!
#define YM 8 // puede ser un pin digital
#define XP 9 // puede ser un pin digital
const int TS_LEFT = 903, TS_RT = 163, TS_TOP = 947, TS_BOT = 165;
#define LCD_CS A3 // La selección de chip pasa al analógico 3
#define LCD_CD A2 // El comando/datos va al analógico 2
#define LCD_WR A1 // La escritura de LCD va al analógico 1
#define LCD_RD A0 // La lectura de LCD va a Analógico 0
#define LCD_RESET A4 // Alternativamente, puede simplemente conectarse al pin de reinicio de Arduino
// Definicion de colores
#define BLACK 0x0000 /* 0, 0, 0 */
#define NAVY 0x000F /* 0, 0, 128 */
#define DARKGREEN 0x03E0 /* 0, 128, 0 */
#define DARKCYAN 0x03EF /* 0, 128, 128 */
#define MAROON 0x7800 /* 128, 0, 0 */
#define PURPLE 0x780F /* 128, 0, 128 */
#define OLIVE 0x7BE0 /* 128, 128, 0 */
#define LIGHTGREY 0xC618 /* 192, 192, 192 */
#define DARKGREY 0x7BEF /* 128, 128, 128 */
#define BLUE 0x001F /* 0, 0, 255 */
#define GREEN 0x07E0 /* 0, 255, 0 */
#define CYAN 0x07FF /* 0, 255, 255 */
#define RED 0xF800 /* 255, 0, 0 */
#define MAGENTA 0xF81F /* 255, 0, 255 */
#define YELLOW 0xFFE0 /* 255, 255, 0 */
#define WHITE 0xFFFF /* 255, 255, 255 */
#define ORANGE 0xFD20 /* 255, 165, 0 */
#define GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#define PINK 0xF81F
#define LIME 0x5FE0
#define GREY 0xE73C
/******************* UI details */
#define BUTTON_X 35
#define BUTTON_H 45
// thermometer graphic coordinates and size
#define thermXTop 155 // thermometer tube top center x coordinate
#define thermYTop 130 // thermometer tube top center y coordinate
#define thermHeight 200 // thermometer tube height
#define thermTubeWidth 30 // thermometer tube width
#define thermBulbRadius 30 // thermometer bulb radius
uint16_t tsID; // touch screen driver type ID
int pixel_x; // touch screen pressed location
int pixel_y; // touch screen pressed location
uint8_t Orientation = 0; // portrait screen orientation
int prevTempLevel = 0; // store last thermometer reading level
bool showDegC = true; // default to displaying in degrees C
Adafruit_GFX_Button buttons[15];
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
int entrada; int aaa; int bbb;
String MissatgeVellP2;
void setup(void) {
Serial.begin(9600);
// Start up the library
sensors1.begin();
// locate devices on the bus
Serial.print("Localizando dispositivos Conrolador 1...");
Serial.print("Encontrado ");
Serial.print(sensors1.getDeviceCount(), DEC);
Serial.println(" dispositivos.");
// report parasite power requirements
Serial.print("La alimentacion parásita en Controlador 1 esta: ");
if (sensors1.isParasitePowerMode())
Serial.println("ON");
else
Serial.println("OFF");
if (!sensors1.getAddress(TempControllerP, 0))
Serial.println("Imposible encontrar direccion para Dispositivo 1 en Controlador 1");
if (!sensors1.getAddress(TempControllerS, 1))
Serial.println("Imposible encontrar direccion para Dispositivo 2 en Controlador 1");
// show the addresses we found on the bus
Serial.print("Dispositivo Primario Direccion: ");
printAddress(TempControllerP);
Serial.println();
Serial.print("Dispositivo Secundario Direccion: ");
printAddress(TempControllerS);
Serial.println();
// set the resolution to 9 bit
sensors1.setResolution(TempControllerP, TEMPERATURE_PRECISION);
sensors1.setResolution(TempControllerS, TEMPERATURE_PRECISION);
Serial.print("Dispositivo Primario Direccion : ");
Serial.print(sensors1.getResolution(TempControllerP), DEC);
Serial.print("Dispositivo Secundario Direccion: ");
Serial.print(sensors1.getResolution(TempControllerS), DEC);
Serial.println();
// Identificador TFT LCD
tft.reset();
uint16_t identifier = tft.readID();
if(identifier == 0x9325) {Serial.println(F("Found ILI9325 LCD driver"));}
else if(identifier == 0x9328) {Serial.println(F("Found ILI9328 LCD driver"));}
else if(identifier == 0x4535) {Serial.println(F("Found LGDP4535 LCD driver"));}
else if(identifier == 0x7575) {Serial.println(F("Found HX8347G LCD driver"));}
else if(identifier == 0x9341) {Serial.println(F("Found ILI9341 LCD driver"));}
else if(identifier == 0x7783) {Serial.println(F("Found ST7781 LCD driver"));}
else if(identifier == 0x8230) {Serial.println(F("Found UC8230 LCD driver"));}
else if(identifier == 0x8357) {Serial.println(F("Found HX8357D LCD driver"));}
else if(identifier==0x0101) {identifier=0x9341;Serial.println(F("Found 0x9341 LCD driver"));}
else if(identifier==0x9481){Serial.println(F("Found 0x9481 LCD driver"));}
else if(identifier==0x9486){Serial.println(F("Found 0x9486 LCD driver"));}
else {
Serial.print(F("Unknown LCD driver chip: "));
Serial.println(identifier, HEX);
Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
Serial.println(F(" #define USE_ADAFRUIT_SHIELD_PINOUT"));
Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
Serial.println(F("If using the breakout board, it should NOT be #defined!"));
Serial.println(F("Also if using the breakout, double-check that all wiring"));
Serial.println(F("matches the tutorial.")); identifier=0x9486;
}
tft.begin(identifier);
}
// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
for (uint8_t i = 0; i < 8; i++)
{
// zero pad the address if necessary
if (deviceAddress[i] < 16) Serial.print("0");
Serial.print(deviceAddress[i], HEX);
}
}
// function to print the temperature for a device
void printTemperature(DallasTemperature &sensor, DeviceAddress deviceAddress)
{
float tempC = sensor.getTempC(deviceAddress);
Serial.print("Temp C: ");
Serial.print(tempC);
}
// function to print a device's resolution
void printResolution(DallasTemperature &sensor, DeviceAddress deviceAddress)
{
Serial.print("Resolution: ");
Serial.print(sensor.getResolution(deviceAddress));
Serial.println();
}
// main function to print information about a device
void printData(DallasTemperature &sensor, DeviceAddress deviceAddress)
{
Serial.print("Device Address: ");
printAddress(deviceAddress);
Serial.print(" ");
printTemperature(sensor, deviceAddress);
Serial.println();
}
void loop(void) {
ControlatorScreen();
}
void ControlatorScreen(){
tft.fillScreen(BLACK); // prepara el color del fons de la pantalla
ThermometerController(); // draw static thermometer background graphics
//tft.setCursor(25, 21); tft.setTextColor(GREEN); tft.setTextSize(2);tft.println("Temperatura Controlador"); // Missatge presetacio pantalla
showmsgtittle(25, 30, 1, &FreeSans12pt7b, "Temperatura Controlador");
// menus de la pantalla
buttons[1].initButton(&tft, 280, 80, 65, BUTTON_H, BLACK, BLACK, WHITE,"", 2); buttons[1].drawButton();
showmsgXYX(260, 85, 1, &FreeSans9pt7b, "Back");
tft.setFont(); // Reset to standard font, to stop using any custom font previously set
buttons[3].initButton(&tft, 40, 80,10, BUTTON_H, BLACK, BLACK, BLACK,"", 2); buttons[3].drawButton();
buttons[4].initButton(&tft, 240, 430, 110, BUTTON_H, CYAN, RED, CYAN,"Grados F", 2); buttons[4].drawButton();
buttons[5].initButton(&tft, 80, 430, 110, BUTTON_H, CYAN, RED, CYAN,"Grados C", 2); buttons[5].drawButton();
//tft.setCursor(70, 220); tft.setTextColor(GREEN); tft.setTextSize(2);tft.println("Aqui el Codigo"); // Missatge presetacio pantalla
//tft.setCursor(75, 270); tft.setTextColor(GREEN); tft.setTextSize(2);tft.println("T/Controlador"); // Missatge presetacio pantalla
TSPoint p = ts.getPoint(); pinMode(XM, OUTPUT); pinMode(YP, OUTPUT);
// Scale from ~0->4000 to tft.width using the calibration #'s
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {p.x = p.x + p.y;p.y = p.x - p.y;p.x = p.x - p.y;p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); p.y = tft.height()-(map(p.y, TS_MINY, TS_MAXY, tft.height(), 0));}
for(aaa=0;aaa<9999;aaa++)
{for(bbb=0;bbb< 9999;bbb++)
{
// Scale from ~0->4000 to tft.width using the calibration #'s
TSPoint p = ts.getPoint(); pinMode(XM, OUTPUT); pinMode(YP, OUTPUT);
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {p.x = p.x + p.y;p.y = p.x - p.y;p.x = p.x - p.y;p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); p.y = tft.height()-(map(p.y, TS_MINY, TS_MAXY, tft.height(), 0));}
// go thru all the buttons, checking if they were pressed
int i;
for (i = 1; i < 12; i++) { // el valor de i permite definir el grosor de la linea
if ((buttons[i].contains(p.x, p.y))&&p.x>10) { buttons[i].press(true);} else {buttons[i].press(false);}
if (buttons[i].justReleased()) {buttons[i].drawButton();}} // draw normal
if (buttons[4].justPressed()) {buttons[4].drawButton(true);
tft.setCursor(200, 420); tft.setTextColor(GREEN); tft.setTextSize(2);tft.println("Grados F");
MissatgeVellP2="";showDegC = (false); }
if (buttons[5].justPressed()) {buttons[5].drawButton(true);
tft.setCursor(40, 420); tft.setTextColor(GREEN); tft.setTextSize(2);tft.println("Grados C");
MissatgeVellP2="";showDegC = (true); }
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors1.requestTemperatures();
Serial.println("DONE");
// print the device information
printData(sensors1, TempControllerP);
printData(sensors1, TempControllerS);
// request temperature sample from DS18B20 on the one wire bus
// Seccion DS18B20 Sensor Temperatura Ambiente=====================================================
sensors1.requestTemperatures();
float TempCont= sensors1.getTempC(1);
if (showDegC)
TempCont = sensors1.getTempC(TempControllerP);
else
TempCont = DallasTemperature::toFahrenheit(sensors1.getTempC(TempControllerP));;
if (TempCont < 20) { // identifica el color a ser
tft.setTextColor(WHITE, BLACK); // displayer temperatura motor
}
else if ((TempCont >= 20) && (TempCont < 30)) {
tft.setTextColor(YELLOW, BLACK);
}
else { // >= 30
tft.setTextColor(RED, BLACK );
}
//tft.setFont(&FreeSans12pt7b);
tft.setTextSize(3);
tft.setCursor(105, 65);
tft.print(TempCont, 1); // show temperature with 1 decimal place
tft.print((char)247); // degree symbol
tft.setTextSize(3);
tft.setCursor(200, 65);
if (showDegC)
tft.print("C ");
else
tft.print("F ");
// -------------------
// update thermometer level graphic if temperature is within graphical range
if ((TempCont <= 100 ) && (TempCont >= 0 )) {
int curTempLevel = map(TempCont, 0, 100, 0, (thermHeight - (thermBulbRadius)));
// update thermometer level if height has changed
if ((prevTempLevel - curTempLevel) != 0) {
// draw new red level
tft.fillRect((thermXTop - (thermTubeWidth / 2) + 6),
thermYTop + ((thermHeight - (thermBulbRadius) - curTempLevel)),
(thermTubeWidth - 12),
curTempLevel,
RED);
// draw new white background above red level height in tube
tft.fillRect((thermXTop - (thermTubeWidth / 2) + 3),
thermYTop,
(thermTubeWidth - 6), (thermHeight - (thermBulbRadius) - curTempLevel),
CYAN);
}
prevTempLevel = curTempLevel; // store bar height for next iteration
}
// check if either of the on screen buttons are pressed and
// change between deg C and F display as required
bool buttonPressed = Touch_getXY();
degC_btn.press(buttonPressed && degC_btn.contains(pixel_x, pixel_y));
degF_btn.press(buttonPressed && degF_btn.contains(pixel_x, pixel_y));
if (degC_btn.justReleased()) // switch to showing degrees C
degC_btn.drawButton();
if (degC_btn.justPressed()) {
degC_btn.drawButton(true);
showDegC = true;
}
if (degF_btn.justReleased()) // switch to showing degrees F
degF_btn.drawButton();
if (degF_btn.justPressed()) {
degF_btn.drawButton(true);
showDegC = false;
}
}}}
// get touch screen pixel location if screen is touched
bool Touch_getXY(void)
{
TSPoint p = ts.getPoint();
pinMode(YP, OUTPUT); // restore shared pins
pinMode(XM, OUTPUT);
digitalWrite(YP, HIGH); // because TFT control pins
digitalWrite(XM, HIGH);
bool pressed = (p.z > MINPRESSURE && p.z < MAXPRESSURE);
if (pressed) {
pixel_x = map(p.x, TS_LEFT, TS_RT, 0, tft.width()); // map x location from analog pos. reading to screen width
pixel_y = map(p.y, TS_TOP, TS_BOT, 0, tft.height()); // map y location from analog pos. reading to screen height
}
return pressed;
}
// draw the background graphics for the thermometer and markings
// this is only drawn once, then the temperature bar is adjusted as needed
void ThermometerController(void)
{
// draw thermometer tube outline
tft.fillRoundRect((thermXTop - (thermTubeWidth / 2)), thermYTop - (thermTubeWidth / 2) + 1,
thermTubeWidth, thermHeight, thermTubeWidth / 2, CYAN); // tube
tft.fillCircle(thermXTop, (thermYTop + thermHeight), (thermBulbRadius), CYAN); // bottom bulb
// fill white thermometer tube inside
tft.fillRoundRect((thermXTop - (thermTubeWidth / 2) + 3), thermYTop - (thermTubeWidth / 2) + 5,
(thermTubeWidth - 6), thermHeight, (thermTubeWidth / 2) - 0.5, CYAN); // tube
tft.fillCircle(thermXTop, (thermYTop + thermHeight), (thermBulbRadius - 3), CYAN); // bottom bulb
// fill red thermometer bulb
tft.fillCircle(thermXTop, (thermYTop + thermHeight), (thermBulbRadius - 6), RED);
// fill red tube to connect between lowest reading level and the bulb reservoir
tft.fillRect((thermXTop - (thermTubeWidth / 2) + 6), thermYTop + thermHeight - thermBulbRadius, (thermTubeWidth - 12), 7, RED);
// draw line markings beside thermometer for visual reference levels
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, thermYTop, 8, 2, BLACK); // top level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.75), 5, 2, WHITE); // 1/4 from top
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.50), 8, 2, WHITE); // center
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.25), 5, 2, WHITE); // 1/4 from bot
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, ((thermYTop + thermHeight) - thermBulbRadius), 8, 2, WHITE); // bottom level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.95), 3, 2, WHITE); // "5" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.90), 3, 2, WHITE); // "10" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.85), 3, 2, WHITE); // "15" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.80), 3, 2, WHITE); // "20" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.70), 3, 2, WHITE); // "30" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.65), 3, 2, WHITE); // "35" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.60), 3, 2, WHITE); // "40" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.55), 3, 2, WHITE); // "45" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.45), 3, 2, WHITE); // "55" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.40), 3, 2, WHITE); // "60" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.35), 3, 2, WHITE); // "65" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.30), 3, 2, WHITE); // "70" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.20), 3, 2, WHITE); // "80" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.15), 3, 2, WHITE); // "85" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.10), 3, 2, WHITE); // "90" level
tft.fillRect(thermXTop + (thermTubeWidth / 2) + 1, (thermYTop + (thermHeight - thermBulbRadius) * 0.05), 3, 2, WHITE); // "95" level
// draw thermometer level indicator numbers
tft.setFont(&FreeSans9pt7b);
tft.setTextColor(YELLOW);
tft.setTextSize(1);
tft.setCursor(((thermXTop + (thermTubeWidth / 2)) + 7), (thermYTop + 12));
tft.print("100");
tft.setFont(); // Reset to standard font, to stop using any custom font previously set
tft.setCursor(207, 124);
tft.setTextSize(2);
tft.print((char)247);
tft.setFont(&FreeSans9pt7b);
tft.setTextColor(YELLOW);
tft.setTextSize(1);
tft.setCursor(((thermXTop + (thermTubeWidth / 2)) + 12), (thermYTop + (thermHeight - thermBulbRadius) * 0.25) + 5);
tft.print("75");
tft.setFont(); // Reset to standard font, to stop using any custom font previously set
tft.setCursor(203, 162);
tft.setTextSize(2);
tft.print((char)247);
tft.setFont(&FreeSans9pt7b);
tft.setTextColor(YELLOW);
tft.setTextSize(1);
tft.setCursor(((thermXTop + (thermTubeWidth / 2)) + 12), (thermYTop + (thermHeight - thermBulbRadius) * 0.5) + 5);
tft.print("50");
tft.setFont(); // Reset to standard font, to stop using any custom font previously set
tft.setCursor(203, 205);
tft.setTextSize(2);
tft.print((char)247);
tft.setFont(&FreeSans9pt7b);
tft.setTextColor(YELLOW);
tft.setTextSize(1);
tft.setCursor(((thermXTop + (thermTubeWidth / 2)) + 12), (thermYTop + (thermHeight - thermBulbRadius) * 0.75) + 5);
tft.print("25");
tft.setFont(); // Reset to standard font, to stop using any custom font previously set
tft.setCursor(203, 250);
tft.setTextSize(2);
tft.print((char)247);
tft.setFont(&FreeSans9pt7b);
tft.setTextColor(YELLOW);
tft.setTextSize(1);
tft.setCursor(((thermXTop + (thermTubeWidth / 2)) + 12), (thermYTop + thermHeight - thermBulbRadius + 5));
tft.print("0");
tft.setFont(); // Reset to standard font, to stop using any custom font previously set
tft.setCursor(194, 290);
tft.setTextSize(2);
tft.print((char)247);
}
void showmsgXYXY(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(WHITE);
tft.setTextSize(sz);
tft.print(msg);
}
void showmsgXYX(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(WHITE);
tft.setTextSize(sz);
tft.print(msg);
}
void showDODGE(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(GREEN);
tft.setTextSize(sz);
tft.print(msg);
delay(1000);
}
void showmsgXY(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(YELLOW);
tft.setTextSize(sz);
tft.print(msg);
delay(1000);
}
void showmsgtittle(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(YELLOW);
tft.setTextSize(sz);
tft.print(msg);
delay(1000);
}
void showmsgambientback(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(WHITE);
tft.setTextSize(sz);
tft.print(msg);
delay(1000);
}