Specifically, 8 seconds (48º) to 12 seconds (72º) will reliably break.
Less critical, but, also annoying, the two halves sometimes have some pixels in between them which are not drawn.
I have not tested whether a drawLine up the middle would work around the missing pixel issue or not.
Code to reproduce problem:
#include <TFTLCD.h>
// Modify as needed for your configuration
#define LCD_RESET A4
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_BL 8 // To Backlight Control Transistor
#define FACECENTRX 63
#define FACECENTRY 63
TFTLCD lcd(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// This should initialize the display and draw a diamond shaped hand rotating around the dial ala a second hand on a clock.
// This example is reduced from an actual clock application to the minimum necessary to replicate the library bug
void setup()
{
lcd.reset();
lcd.initDisplay();
lcd.fillScreen(lcd.Color565(0,0,0));
lcd.setRotation(2);
pinMode(LCD_BL, OUTPUT);
digitalWrite(LCD_BL, HIGH);
int i;
while (1)
{
for(i=0; i<360; i+=6)
{
drawHand(lcd, i, 46, 255,255,255, 10);
delay(1000);
drawHand(lcd, i, 46, 0, 0, 0, 10);
}
}
}
void drawHand(TFTLCD D2, int a, int d, byte r, byte g, byte b, int width)
{
float c,w, z;
int dh_x2, dh_y2;
int dh_x1, dh_y1;
unsigned int co;
float rad;
co=D2.Color565(r,g,b);
c = ((a+270)%360); // orient correctly
z = c = c * PI/180;
// Draw hands as polygons (fast)
dh_x1 = cos(c)*d+FACECENTRX; dh_y1 = sin(c)*d+FACECENTRY; // tip of hand
w=width*PI/180;
c -= w/2; // Widen (go counterclockwise w/2 radians (== width/2 degrees)
rad = d*(d<40 ? 0.6 : 0.
dh_x2 = cos(c)*rad+FACECENTRX; dh_y2 = sin(c)*rad+FACECENTRY; // Counterclockwise wide point
D2.fillTriangle(FACECENTRX, FACECENTRY, dh_x1, dh_y1, dh_x2, dh_y2, D2.Color565(r, g, b)); // Draw counterclockwise half of hand
c += w; // Widen other direction (clockwise w radians == width degrees from counterclockwise edge)
dh_x2 = cos(c)*rad+FACECENTRX; dh_y2 = sin(c)*rad+FACECENTRY; // Colckwise wide point
D2.fillTriangle(FACECENTRX, FACECENTRY, dh_x1, dh_y1, dh_x2, dh_y2, D2.Color565(r, g, b)); // Draw clockwise half of hand
}
void loop()
{
}

