Added text mode example

This commit is contained in:
KTOWN 2013-10-14 20:08:21 +02:00
parent e86987d1c4
commit ae0b2d2b61
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"
#define RA8875_INT 3
#define RA8875_CS 10
#define RA8875_RESET 9
Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RESET);
uint16_t tx, ty;
void setup()
{
Serial.begin(9600);
Serial.println("RA8875 start");
/* Initialise the display using 'RA8875_480x272' or 'RA8875_800x480' */
if (!tft.begin(RA8875_800x480)) {
Serial.println("RA8875 Not Found!");
while (1);
}
tft.displayOn(true);
tft.GPIOX(true); // Enable TFT - display enable tied to GPIOX
tft.PWM1config(true, RA8875_PWM_CLK_DIV1024); // PWM output for backlight
tft.PWM1out(255);
tft.fillScreen(RA8875_BLACK);
tft.textMode();
tft.textTransparent(RA8875_WHITE);
uint8_t string[14] = "Hello, World!";
tft.textWrite(string, 14);
}
void loop()
{
}