Ejemplo n.º 1
0
unsigned long testText() {
    tft.fillScreen(ILI9341_BLACK);
    unsigned long start = micros();
    tft.setCursor(0, 0);
    tft.setTextColor(ILI9341_WHITE);
    tft.setTextSize(1);
    tft.println("Hello World!");
    tft.setTextColor(ILI9341_YELLOW);
    tft.setTextSize(2);
    tft.println(1234.56);
    tft.setTextColor(ILI9341_RED);
    tft.setTextSize(3);
    tft.println(0xDEADBEEF, HEX);
    tft.println();
    tft.setTextColor(ILI9341_GREEN);
    tft.setTextSize(5);
    tft.println("Groop");
    tft.setTextSize(2);
    tft.println("I implore thee,");
    tft.setTextSize(1);
    tft.println("my foonting turlingdromes.");
    tft.println("And hooptiously drangle me");
    tft.println("with crinkly bindlewurdles,");
    tft.println("Or I will rend thee");
    tft.println("in the gobberwarts");
    tft.println("with my blurglecruncheon,");
    tft.println("see if I don't!");
    return micros() - start;
}
Ejemplo n.º 2
0
/************************************ 
 * Name    : print_item
 * Purpuse : 
 * Inputs  : None
 * Outputs : None
 * Returns : None
 ************************************/
int  print_item(int line, char *iname, float value, char *unit)
{
  int stPos;
  if (line <= 0) return -1;
  stPos = (line-1)*PERIOD;
  tft.fillRect(0, stPos, 240, TEXTSIZE, ILI9341_BLACK);
  tft.setCursor(2, stPos);
  tft.setTextColor(ILI9341_WHITE);  
  tft.setTextSize(FONTSIZE);
  tft.print(iname);
  tft.print(value, 2);  
  tft.print(" ");
  tft.print(unit);  
}