// UTFT_Textrotation_Demo (C)2014 Henning Karlsen // web: http://www.henningkarlsen.com/electronics // // This program is a demo of the textrotation-functions. // // This demo was made for modules with a screen resolution // of 320x240 pixels. // This program requires the UTFT library. // // Modified for the 480x320 shield by A.Tedds #include // Declare which fonts we will be using extern uint8_t BigFont[]; extern uint8_t SevenSegNumFont[]; // Set the pins to the correct ones for your development shield // ------------------------------------------------------------ // Arduino Uno / 2009: // ------------------- // Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2 // DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2 // // Arduino Mega: // ------------------- // Standard Arduino Mega/Due shield : ,38,39,40,41 // CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41 // // Remember to change the model parameter to suit your display module! UTFT myGLCD(HX8357C,38,39,40,41);// Set Graphic Driver Chip and Arduino Pins. void setup() { myGLCD.InitLCD(); // myGLCD.clrScr(); // myGLCD.setFont(BigFont); } void loop() { //myGLCD.InitLCD(); //delay(50); myGLCD.clrScr(); delay(50); myGLCD.setFont(BigFont); delay(50); myGLCD.setColor(255,255,255); myGLCD.print("Text rotation", 150, 160); // Horizontal 150,Vertical 25 delay(2000); myGLCD.setColor(0, 0, 255); // Blue Text myGLCD.print("0 degrees rotate", 110, 0, 0); // Hor,Vert,Rotate delay(1000); myGLCD.print("90 degrees rotate", 479, 25, 90); // Hor,Vert,Rotate delay(1000); myGLCD.print("180 degrees rotate", 370, 319, 180); // Hor,Vert,Rotate delay(1000); myGLCD.print("270 degrees rotate", 0, 300, 270); // Hor,Vert,Rotate delay(1000); myGLCD.setFont(SevenSegNumFont); myGLCD.setColor(0, 255, 0); // Green Text myGLCD.print("0",230,25,0); // Hor,Vert,Rotate delay(1000); myGLCD.print("45", 335, 40, 45); // Hor,Vert,Rotate delay(1000); myGLCD.print("90", 450, 135, 90); // Hor,Vert,Rotate delay(1000); myGLCD.print("135", 400, 230, 135); // Hor,Vert,Rotate delay(1000); myGLCD.print("180", 300, 300, 180); // Hor,Vert,Rotate delay(1000); myGLCD.print("225", 150, 300, 225); // Hor,Vert,Rotate delay(1000); myGLCD.print("270", 30, 220, 270); // Hor,Vert,Rotate delay(1000); myGLCD.print("315", 90, 105, 315); // Hor,Vert,Rotate delay(5000); //while (true) {}; }