output

Dependencies:   images mbed

Fork of display by madhu sudhana

Committer:
madhusudhana
Date:
Wed Jun 13 11:34:37 2018 +0000
Revision:
2:e7a5b9bc75b4
Parent:
1:b64c81071d96
Child:
3:7d97b4f535c6
1.44 tft display;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
morita 0:c0be4e018a09 1 /**
morita 0:c0be4e018a09 2 * @file main.c
morita 0:c0be4e018a09 3 * @brief ILI9163/DL144128TF 128x128 TFT LCD Test code
morita 0:c0be4e018a09 4 *
morita 0:c0be4e018a09 5 * This program is free software: you can redistribute it and/or modify
morita 0:c0be4e018a09 6 * it under the terms of the GNU General Public License as published by
morita 0:c0be4e018a09 7 * the Free Software Foundation, either version 3 of the License, or
morita 0:c0be4e018a09 8 * (at your option) any later version.
morita 0:c0be4e018a09 9 *
morita 0:c0be4e018a09 10 * This program is distributed in the hope that it will be useful,
morita 0:c0be4e018a09 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
morita 0:c0be4e018a09 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
morita 0:c0be4e018a09 13 * GNU General Public License for more details.
morita 0:c0be4e018a09 14 *
morita 0:c0be4e018a09 15 * You should have received a copy of the GNU General Public License
morita 0:c0be4e018a09 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
morita 0:c0be4e018a09 17 *
morita 0:c0be4e018a09 18 * @author Jun Morita (iccraft)
morita 0:c0be4e018a09 19 *
morita 0:c0be4e018a09 20 * @copyright Copyright (C) 2012 Simon Inns
morita 0:c0be4e018a09 21 * @author Simon Inns <simon.inns@gmail.com>
morita 0:c0be4e018a09 22 */
morita 0:c0be4e018a09 23
morita 0:c0be4e018a09 24 #include "mbed.h"
morita 0:c0be4e018a09 25 #include "ili9163lcd.h"
madhusudhana 2:e7a5b9bc75b4 26 #include "stdint.h"
morita 0:c0be4e018a09 27
rs27 1:b64c81071d96 28 ILI9163 TFT(D2,D3,D4,D5,D6);
morita 0:c0be4e018a09 29
morita 0:c0be4e018a09 30 int main()
morita 0:c0be4e018a09 31 {
morita 0:c0be4e018a09 32 while(1)
morita 0:c0be4e018a09 33 {
madhusudhana 2:e7a5b9bc75b4 34 int X=DarkGreen;
rs27 1:b64c81071d96 35
madhusudhana 2:e7a5b9bc75b4 36 TFT.lcdInitialise(LCD_ORIENTATION0);
madhusudhana 2:e7a5b9bc75b4 37 TFT.lcdClearDisplay(X);
madhusudhana 2:e7a5b9bc75b4 38 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 39 TFT.lcdLine(0, 0, 127, 127, Red);
madhusudhana 2:e7a5b9bc75b4 40 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 41 TFT.lcdLine(0, 127, 127, 0, Red);
madhusudhana 2:e7a5b9bc75b4 42 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 43 TFT.lcdCircle(64, 64, 32, Red);
madhusudhana 2:e7a5b9bc75b4 44 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 45 TFT.lcdCircle(64, 64, 40, Blue);
madhusudhana 2:e7a5b9bc75b4 46 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 47 TFT.lcdCircle(64, 64, 48, Green);
madhusudhana 2:e7a5b9bc75b4 48 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 49
madhusudhana 2:e7a5b9bc75b4 50 TFT.lcdFilledRectangle(12,12,120,120,Green);
madhusudhana 2:e7a5b9bc75b4 51 TFT.lcdFilledRectangle(62, 62, 65, 65, Green);
madhusudhana 2:e7a5b9bc75b4 52 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 53
madhusudhana 2:e7a5b9bc75b4 54 TFT.lcdClearDisplay(X);
madhusudhana 2:e7a5b9bc75b4 55 TFT.set_font((unsigned char*)font11x16);
madhusudhana 2:e7a5b9bc75b4 56
madhusudhana 2:e7a5b9bc75b4 57 TFT.lcdPutS("SENSESEMI", TFT.lcdTextX(1), TFT.lcdTextY(2),White,Blue);
madhusudhana 2:e7a5b9bc75b4 58 //TFT.lcdPutS("Hello World!", TFT.lcdTextX(4), TFT.lcdTextY(0), Blue, Cyan); // Vordergund, Hintergrund
madhusudhana 2:e7a5b9bc75b4 59 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 60 TFT.set_font((unsigned char*)font12x12);
madhusudhana 2:e7a5b9bc75b4 61 TFT.lcdClearDisplay(X);
madhusudhana 2:e7a5b9bc75b4 62 TFT.lcdPutS("The quick brown fox jumped over the lazy dog 0123456789", TFT.lcdTextX(0), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 63 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 64 TFT.lcdClearDisplay(X);
madhusudhana 2:e7a5b9bc75b4 65 TFT.lcdPutS("BP=120 ECG=78 SUGAR=80", TFT.lcdTextX(2), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 66
madhusudhana 2:e7a5b9bc75b4 67 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 68 TFT.lcdInitialise(LCD_ORIENTATION1);
madhusudhana 2:e7a5b9bc75b4 69 TFT.set_font((unsigned char*)font12x12);
madhusudhana 2:e7a5b9bc75b4 70 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 71 TFT.lcdPutS("The quick brown fox jumped over the lazy dog 0123456789", TFT.lcdTextX(0), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 72 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 73 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 74 TFT.lcdPutS("BP=120 ECG=78 SUGAR=80", TFT.lcdTextX(2), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 75 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 76 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 77
madhusudhana 2:e7a5b9bc75b4 78 TFT.lcdInitialise(LCD_ORIENTATION2);
madhusudhana 2:e7a5b9bc75b4 79
madhusudhana 2:e7a5b9bc75b4 80 TFT.set_font((unsigned char*)font12x12);
madhusudhana 2:e7a5b9bc75b4 81 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 82 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 83 TFT.lcdPutS("The quick brown fox jumped over the lazy dog 0123456789", TFT.lcdTextX(0), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 84 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 85 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 86 TFT.lcdPutS("BP=120 ECG=78 SUGAR=80", TFT.lcdTextX(2), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 87 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 88 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 89
madhusudhana 2:e7a5b9bc75b4 90
madhusudhana 2:e7a5b9bc75b4 91 TFT.lcdInitialise(LCD_ORIENTATION3);
madhusudhana 2:e7a5b9bc75b4 92 TFT.set_font((unsigned char*)font12x12);
madhusudhana 2:e7a5b9bc75b4 93 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 94 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 95 TFT.lcdPutS("The quick brown fox jumped over the lazy dog 0123456789", TFT.lcdTextX(0), TFT.lcdTextY(4), White,Red);
madhusudhana 2:e7a5b9bc75b4 96 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 97 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 98 TFT.lcdPutS("BP=120 ECG=78 SUGAR=80", TFT.lcdTextX(2), TFT.lcdTextY(4), White, Red);
madhusudhana 2:e7a5b9bc75b4 99 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 100 TFT.lcdClearDisplay(White);
madhusudhana 2:e7a5b9bc75b4 101 wait_ms(300);
madhusudhana 2:e7a5b9bc75b4 102
madhusudhana 2:e7a5b9bc75b4 103 // TFT.lcdWriteData(NXP_whole_bmp[i], NXP_whole_bmp[i+1]);// for bit mapping
madhusudhana 2:e7a5b9bc75b4 104
madhusudhana 2:e7a5b9bc75b4 105
morita 0:c0be4e018a09 106 }
morita 0:c0be4e018a09 107 }