Created
August 30, 2014 16:15
-
-
Save circuitsenses/7a15dc8af0562fbe1bf8 to your computer and use it in GitHub Desktop.
Armjishu TFT LCD + Arduino Mega
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UTFT_ViewFont (C)2012 Henning Karlsen | |
// web: http://www.henningkarlsen.com/electronics | |
// | |
// This program is a demo of the included fonts. | |
// | |
// This demo was made for modules with a screen resolution | |
// of 320x240 pixels. | |
// | |
// This program requires the UTFT library. | |
// | |
#include <UTFT.h> | |
// Declare which fonts we will be using | |
extern uint8_t SmallFont[]; | |
extern uint8_t BigFont[]; | |
extern uint8_t SevenSegNumFont[]; | |
// Uncomment the next line for Arduino 2009/Uno | |
//UTFT myGLCD(ITDB32S,19,18,17,16); // Remember to change the model parameter to suit your display module! | |
#define RS 38 | |
#define WR 39 | |
#define CS 40 | |
#define RST 41 | |
// Uncomment the next line for Arduino Mega | |
UTFT myGLCD(SSD1289, RS, WR, CS, RST); // Remember to change the model parameter to suit your display module! | |
void setup() | |
{ | |
myGLCD.InitLCD(); | |
myGLCD.clrScr(); | |
} | |
void loop() | |
{ | |
myGLCD.setColor(100, 50, 60); | |
myGLCD.setBackColor(0, 0, 0); | |
myGLCD.setFont(BigFont); | |
myGLCD.print(" !\"#$%&'()*+,-./", CENTER, 0); | |
myGLCD.print("0123456789:;<=>?", CENTER, 16); | |
myGLCD.print("@ABCDEFGHIJKLMNO", CENTER, 32); | |
myGLCD.print("PQRSTUVWXYZ[\\]^_", CENTER, 48); | |
myGLCD.print("`abcdefghijklmno", CENTER, 64); | |
myGLCD.print("pqrstuvwxyz{|}~ ", CENTER, 80); | |
myGLCD.setFont(SmallFont); | |
myGLCD.print(" !\"#$%&'()*+,-./0123456789:;<=>?", CENTER, 120); | |
myGLCD.print("@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_", CENTER, 132); | |
myGLCD.print("`abcdefghijklmnopqrstuvwxyz{|}~ ", CENTER, 144); | |
myGLCD.setFont(SevenSegNumFont); | |
myGLCD.print("52849", CENTER, 190); | |
while(1) {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment