Teensy 3.6 and Adafruit RA8875

Status
Not open for further replies.

BabySpinach

Active member
Hello all,

I've been trying to get basic fonts working on the Adafruit RA8875 800x480 display. I can't seem to get the display working with any examples except the built in build test example from the Adafruit library. I've tried compiling and successfully uploading Sumotoy's RA8875 code, but the screen just goes white. I've followed documentation and steps to create a new font, but I have no idea where I should be interfacing the .c file..

Am I missing something really simple here?? Is there an easier way to get fonts working? Do I just need to change references in the main RA8875 library somewhere? Seems a bit crazy to spend over 6 hours with no luck so far..

Here is the only bit of working code (All sumotoy's code results in a white screen):

Code:
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"


// Library only supports hardware SPI at this time
// Connect SCLK to UNO Digital #13 (Hardware SPI clock)
// Connect MISO to UNO Digital #12 (Hardware SPI MISO)
// Connect MOSI to UNO Digital #11 (Hardware SPI MOSI)
#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);
  }

  Serial.println("Found RA8875");

  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);

  // With hardware accelleration this is instant
  tft.fillScreen(RA8875_BLACK);

  /*// Play with PWM
  for (uint8_t i=255; i!=0; i-=5 ) 
  {
    tft.PWM1out(i); 
    delay(10);
  }  
  for (uint8_t i=0; i!=255; i+=5 ) 
  {
    tft.PWM1out(i); 
    delay(10);
  }
  tft.PWM1out(255); */

  
  tft.drawRect(5,50,60,340,RA8875_GREEN);
  tft.drawRect(70,50,265,265,RA8875_GREEN);
  tft.drawRect(70,315,265,75,RA8875_GREEN);
  tft.drawLine(400,0,400,480,RA8875_WHITE);

  tft.drawRect(800*.1,480*.1,800*.25,480*.25,RA8875_BLUE);
  
  
  tft.textMode();
  char fuelGals[6] = "x/GAL";
  char fuelLvl[11] = "FUEL LEVEL";

  tft.textSetCursor(5,15);
  tft.textTransparent(RA8875_WHITE);
  tft.textWrite(fuelGals);

  tft.textSetCursor(5,30);
  tft.textTransparent(RA8875_WHITE);
  tft.textWrite(fuelLvl);
}

void loop() 
{
}
 
Status
Not open for further replies.
Back
Top