mirror of
https://github.com/YuzuZensai/MCUFRIEND_kbv.git
synced 2026-01-31 14:57:48 +00:00
update RinkyDink demo
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// UTFT_Demo_400x240 (C)2012 Henning Karlsen
|
||||
// web: http://www.henningkarlsen.com/electronics
|
||||
// UTFT_Demo_400x240
|
||||
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
|
||||
// web: http://www.RinkyDinkElectronics.com/
|
||||
//
|
||||
// This program is a demo of how to use most of the functions
|
||||
// of the library with a supported display modules.
|
||||
@@ -10,27 +11,36 @@
|
||||
// This program requires the UTFT library.
|
||||
//
|
||||
|
||||
//#include <Adafruit_GFX.h>
|
||||
//#include <Adafruit_TFTLCD.h>
|
||||
#include <MCUFRIEND_kbv.h>
|
||||
#include <UTFTGLUE.h>
|
||||
//UTFTGLUE myGLCD; // use for default shield
|
||||
UTFTGLUE myGLCD(0x9327,A2,A1,A3,A4,A0);
|
||||
extern uint8_t SmallFont[];
|
||||
//################################################
|
||||
// GLUE class that implements the UTFT API
|
||||
// replace UTFT include and constructor statements
|
||||
// remove UTFT font declaration e.g. SmallFont
|
||||
//################################################
|
||||
|
||||
/*
|
||||
#include <UTFT.h>
|
||||
#include <UTFTGLUE.h> //use GLUE class and constructor
|
||||
UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args
|
||||
|
||||
// Declare which fonts we will be using
|
||||
#if !defined(SmallFont)
|
||||
extern uint8_t SmallFont[]; //.kbv GLUE defines as GFXFont ref
|
||||
#endif
|
||||
//extern uint8_t SmallFont[];
|
||||
|
||||
// Set the pins to the correct ones for your development shield
|
||||
// ------------------------------------------------------------
|
||||
// Arduino Uno / 2009:
|
||||
// -------------------
|
||||
// Standard Arduino Uno/2009 shield : <display model>,A5,A4,A3,A2
|
||||
// DisplayModule Arduino Uno TFT shield : <display model>,A5,A4,A3,A2
|
||||
//
|
||||
// Arduino Mega:
|
||||
// -------------------
|
||||
// Standard Arduino Mega/Due shield : <display model>,38,39,40,41
|
||||
// CTE TFT LCD/SD Shield for Arduino Mega : <display model>,38,39,40,41
|
||||
//
|
||||
// Remember to change the model parameter to suit your display module!
|
||||
//UTFT myGLCD(ITDB32WD,38,39,40,41);
|
||||
|
||||
void setup()
|
||||
{
|
||||
randomSeed(analogRead(5)); //.kbv Due does not like A0
|
||||
pinMode(A0, OUTPUT); //.kbv mcufriend have RD on A0
|
||||
digitalWrite(A0, HIGH);
|
||||
randomSeed(analogRead(0));
|
||||
|
||||
// Setup the LCD
|
||||
myGLCD.InitLCD();
|
||||
@@ -56,7 +66,7 @@ void loop()
|
||||
myGLCD.print("*** Universal Color TFT Display Library ***", CENTER, 1);
|
||||
myGLCD.setBackColor(64, 64, 64);
|
||||
myGLCD.setColor(255,255,0);
|
||||
myGLCD.print("< http://electronics.henningkarlsen.com >", CENTER, 227);
|
||||
myGLCD.print("< http://www.RinkyDinkElectronics.com/ >", CENTER, 227);
|
||||
|
||||
myGLCD.setColor(0, 0, 255);
|
||||
myGLCD.drawRect(0, 14, 399, 225);
|
||||
@@ -331,4 +341,3 @@ void loop()
|
||||
|
||||
delay (10000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user