In the code below, the fillTriangle() stops filling about halfway down the screen. drawTriangle() and it seems any other fill/draw call seems to work just fine. What could be causing this?
I'm using stock Adafruit GFX and ILI9341 libraries.
Thanks for any help.
I'm using a Teensy 4.1 with a 320x240 TFT https://www.pjrc.com/store/display_ili9341_touch.html
output:
I'm using stock Adafruit GFX and ILI9341 libraries.
Thanks for any help.
I'm using a Teensy 4.1 with a 320x240 TFT https://www.pjrc.com/store/display_ili9341_touch.html
output:
Code:
#include <Arduino.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SPI.h>
const uint16_t tft_Color_Black = 0x0000;
const uint16_t tft_Color_Blue = 0x001F;
const uint16_t tft_Color_Red = 0xF800;
#define TFT_CS 10
#define TFT_DC 9
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
delay(250);
tft.begin();
tft.setFont();
tft.fillScreen(tft_Color_Black);
tft.setRotation(0);
}
GFXcanvas16 *canvas = new GFXcanvas16 (240, 320); //
void loop() {
canvas -> drawTriangle(0, 0, 240, 0, 120, 320, tft_Color_Red); // This works fine
canvas -> fillTriangle(0, 0, 240, 0, 120, 272, tft_Color_Blue); // This is what stops halfway down screen.
// tft.fillTriangle(0, 0, 240, 0, 120, 272, tft_Color_Blue); // <- This would work fine.
tft.drawRGBBitmap(0 , 0 , canvas -> getBuffer () , 240 , 320);
}