ILI9325 based TFT Arduino shield on KL25Z
Dependencies: TFTLCD_8bit mbed
This is for cheap touch screen TFT from Thiha Electronics (http://www.thiha-elec.com/shield.html).
main.cpp@5:922253f4e70b, 2014-12-03 (annotated)
- Committer:
- ThihaElectronics
- Date:
- Wed Dec 03 16:35:36 2014 +0000
- Revision:
- 5:922253f4e70b
- Parent:
- 4:471d7c5e8360
- Child:
- 6:f7d4a6a500f3
tried to update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ThihaElectronics | 0:968ea69b9984 | 1 | #include "mbed.h" |
ThihaElectronics | 5:922253f4e70b | 2 | #include "ili9328.h" |
ThihaElectronics | 5:922253f4e70b | 3 | |
ThihaElectronics | 0:968ea69b9984 | 4 | // prepare the data bus for writing commands and pixel data |
ThihaElectronics | 0:968ea69b9984 | 5 | //BusOut dataBus( p30, p29, p28, p27, p26, p25, p24, p23, p22, p21, p20, p19, p18, p17, p16, p15 ); // 16 pins |
ThihaElectronics | 0:968ea69b9984 | 6 | BusOut dataBus( PTA13, PTD5, PTD4, PTA12, PTA4, PTA5, PTC8, PTC9 ); // 16 pins |
ThihaElectronics | 0:968ea69b9984 | 7 | // create the lcd instance |
ThihaElectronics | 5:922253f4e70b | 8 | ILI9328_LCD lcd( PTB3, PTC2, PTB2, PTB1, &dataBus, NC, PTB0); // control pins and data bus |
ThihaElectronics | 0:968ea69b9984 | 9 | //CS, RESET, RS, WR |
ThihaElectronics | 0:968ea69b9984 | 10 | int main() |
ThihaElectronics | 0:968ea69b9984 | 11 | { |
ThihaElectronics | 0:968ea69b9984 | 12 | // initialize display - place it in standard portrait mode and set background to black and |
ThihaElectronics | 0:968ea69b9984 | 13 | // foreground to white color. |
ThihaElectronics | 0:968ea69b9984 | 14 | lcd.Initialize(); |
ThihaElectronics | 5:922253f4e70b | 15 | // set current font to the smallest 8x12 pixels font. |
ThihaElectronics | 5:922253f4e70b | 16 | // lcd.SetFont( Font8x12 ); |
ThihaElectronics | 5:922253f4e70b | 17 | // print something on the screen |
ThihaElectronics | 5:922253f4e70b | 18 | lcd.Print( "Hello, World!", CENTER, 50); // align text to center horizontally and use starndard colors |
ThihaElectronics | 0:968ea69b9984 | 19 | |
ThihaElectronics | 0:968ea69b9984 | 20 | while ( 1 ) { } |
ThihaElectronics | 0:968ea69b9984 | 21 | } |