How to draw Fill Triangle using the library Adafruit GFX library?

david_prentice:
First off. Make sure that your libraries are up to date via the Library Manager.

I would delete any libraries that came on your CD. Only use libraries from the Library Manager.
i.e. Adafruit_GFX, MCUFRIEND_kbv, TouchScreen

The fillTriangle() method should work. Please post your sketch. I suspect that you just have a typo somewhere.

David.

Hi, This is my Code:

#include <TouchScreen.h>  //Librería para utilizar el Touch de la Pantalla
#include <Adafruit_GFX.h> //Librería Necesaria
#include <UTFTGLUE.h>     //Librería Necesaria
#include <stdint.h>
#include <Wire.h>

extern uint8_t SmallFont[];
extern uint8_t BigFont[]; //Declaramos cuales fuentes vamos a utilizar
extern uint8_t SevenSegNumFont[];
extern uint8_t GroteskBold32x64[];

UTFTGLUE myGLCD(0x9486, A2, A1, A3, A4, A0); //Declaramos el controlador de nuestra pantalla

//Definir pines para controlar la pantalla
#define XP 9  //Pin de control digital
#define YP A2 //Pin análogo de control
#define XM A3 //Pin análogo de control
#define YM 8  //Pin digital de control

//Definir los niveles de presión mínima y máxima
#define MINPRESSURE 10
#define MAXPRESSURE 1000

//Definir los valores para calibrar la pantalla táctil
#define X_STPT 70  //Valor de X inicial
#define X_ENPT 930 //Valor de X final
#define Y_STPT 125 //Valor de Y inicial
#define Y_ENPT 910 //Valor de Y final

TouchScreen myTouch = TouchScreen(XP, YP, XM, YM, 300);

#define NEGRO     0x0000
#define AZUL      0x001F
#define ROJO      0xF800
#define VERDE     0x07E0
#define CIAN      0x07FF
#define MAGENTA   0xF81F
#define AMARILLO  0xFFE0
#define BLANCO    0xFFFF

int color;
int led = 10; //Pin PWM donde va conectado el LED

//Define el ancho y largo de la pantalla en pixeles
int x_size = 480; int y_size = 320;
bool settscrsize (int w, int h) {
  if ((w <= 0) || (h <= 0)) return false;
  x_size = w; y_size = h;
  return true;
}


void LogoSielco(int x1, int y1) {
  myGLCD.setFont(BigFont);
  myGLCD.setColor(ROJO);
  tft.fillTriangle(x1, y1, x1 + 19, y1, x1, y1 + 19,ROJO);
  tft.fillTriangle(x1 + 18, y1 + 1, x1 + 23, y1 - 5, x1 + 12, y1 + 1,ROJO);
  tft.fillTriangle(x1 + 2, y1 + 18, x1 + 4, y1 + 18, x1 + 2, y1 + 14,ROJO);
  tft.fillTriangle(x1 + 3, y1 + 14, x1 + 8, y1 + 14, x1 + 5, y1 + 19,ROJO);
  myGLCD.setColor(NEGRO);
  myGLCD.setBackColor(BLANCO);
  tft.fillTriangle(x1 + 23, y1 + 6, x1 + 23, y1 + 26, x1 + 3, y1 + 26,NEGRO);
  tft.fillTriangle(x1 + 2, y1 + 27, x1 - 1, y1 + 31, x1 + 7, y1 + 27,NEGRO);
  tft.fillTriangle(x1 + 21, y1 + 7, x1 + 18, y1 + 7, x1 + 20, y1 + 10,NEGRO);
  tft.fillTriangle(x1 + 18, y1 + 5, x1 + 13, y1 + 12, x1 + 19, y1 + 12,NEGRO);
  myGLCD.print("Sielco", x1 + 24, y1 + 5, 0);
}

void setup{
  myGLCD.InitLCD(1);
  myGLCD.clrScr();
  myGLCD.setFont(BigFont);
  myGLCD.setBrightness(0);
  myGLCD.fillScr(BLANCO);
  myTouch.InitTouch();
  myTouch.setPrecision(PREC_HI);
}

void loop{
  LogoSielco(180, 80);
}