From ae0b2d2b612506353d53755181d66a0beab0ae8b Mon Sep 17 00:00:00 2001 From: KTOWN Date: Mon, 14 Oct 2013 20:08:21 +0200 Subject: [PATCH] Added text mode example --- examples/textmode/textmode.ino | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 examples/textmode/textmode.ino diff --git a/examples/textmode/textmode.ino b/examples/textmode/textmode.ino new file mode 100644 index 0000000..e0d4096 --- /dev/null +++ b/examples/textmode/textmode.ino @@ -0,0 +1,37 @@ +#include +#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() +{ +} \ No newline at end of file