NHD 5.0-800480FT Ptrogramming Issues
I purchased a 5" TFT LCD Arduino Shield kit with an Arduino Mega controller. I tried running the example program given in the data sheet link: https://newhavendisplay.com/content/specs/NHD-5.0-800480FT-CTXL-CTP.pdf https://github.com/NewhavenDisplay/EVE2-TFT-Modules but only two of them worked the sketch and the gradient. Whenever I load the keyboard and graph to the board it just flashes a blinding white screen constantly. Also I'm trying to program a screen on my own and was given a manual to program it using the gameduino library file:///Downloads/NHD-Gameduino2-AppNotes.pdf. But when I follow the example all it does is flash once and then goes back to being a blank screen. I will put my code below. Can you tell me what I did wrong or how I can fix this issue.
#include <EEPROM.h>
#include <SPI.h>
#include <GD2.h>
void tft_5()
{
GD.wr16(REG_HSIZE, 800);
GD.wr16(REG_HCYCLE, 928);
GD.wr16(REG_HOFFSET, 88);
GD.wr16(REG_HSYNC0, 0);
GD.wr16(REG_HSYNC1, 48);
GD.wr16(REG_VSIZE, 480);
GD.wr16(REG_VCYCLE, 525);
GD.wr16(REG_VOFFSET, 32);
GD.wr16(REG_VSYNC0, 0);
GD.wr16(REG_VSYNC1, 3);
GD.wr16(REG_PCLK, 2);
GD.wr16(REG_SWIZZLE, 0);
GD.wr16(REG_PCLK_POL, 0);
GD.wr16(REG_CSPREAD, 1);
GD.wr16(REG_DITHER, 1);
GD.wr16(REG_ROTATE, 0);
}
void setup()
{
GD.begin(0, 10, 5);
tft_5();
}
void loop()
{
GD.ClearColorRGB(0x103000);
GD.Clear();
GD.cmd_text(GD.w / 2, GD.h / 2, 31, OPT_CENTER, "Hello world");
GD.swap();
}
Please sign in to leave a comment.
Comments
0 comments