Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 6 months ago.
LCD TFT Library
Hi there
I am quite new to this.
I have a 2.8" TFT LCD (HX8347) screen and currently trying to get it working with my Nucleo F401RE.
I imported the library located here: https://developer.mbed.org/users/Suky/code/LCDTFT/
I deleted the code to draw images (don't need it and it was throwing an error).
The problem is it looks like the example code uses a different set of definitions for the pins
pin definitions
#include "mbed.h" #include "LCDTFT.h" BusOut MyBus(p13,p14,p15,p16,p17,p18,p19,p20,p30,p29,p28,p27,p26,p25,p24,p23); LCDTFT MyLCD(p5,p6,p7,p22,p21,&MyBus);
This throws an error as the "p" values don't exist. So I figured they are "D0", "D1", ... . But I am not sure at all, even what sort of mapping, (it goes to 30??).
Thanks for any help
1 Answer
8 years, 6 months ago.
That lib was written for the LPC1768 platform. The LPC1768 uses p1, p2 etc to identify its pinnumbers. Based on your profile page you seem to have a nucleo board and you must therefore use the pinnames that are valid for that platform. You can either use the D0 etc names (ie Arduino compatible pins) or better yet use the port and pinnumber of the processor on your nucleo board. Check the nucleo platform page or board manual for details.
Note that this lib uses a parallel interface to the LCD (address, data and controllines). Check the lib documentation to figure out what each pin's function is. Unfortunately this interface mode will use up pretty much all available pins of the processor so there is not much else you can hook up. A better solution, although probably a bit slower, would be to use an LCD that supports a serial SPI interface which needs only about 4 pins.