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.
Error: No instance of constructor "ILI9341::ILI9341"
Hello! I'm trying to implement the tft screen init, but get this error: Error: No instance of constructor "ILI9341::ILI9341" matches the argument list in "main.cpp", Line: 26, Col: 15
Code
BusOut dataBus( PA_5, PA_3, PA_2, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15 ); ILI9341 disp(BUS_16, &dataBus, PA_13, PA_14, PA_12, PA_11, PA_8, "WF28D");
Please help
1 Answer
8 years, 6 months ago.
Turns out the constructor has been declared in a different way, instead of accepting a "BusOut" object it accepts an array of pinnames.
I think something like this may work. Note there's no "&" before databus as an array is a pointer.
PinName[16] dataBus = { PA_5, PA_3, PA_2, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15 }; ILI9341 disp(BUS_16, dataBus, PA_13, PA_14, PA_12, PA_11, PA_8, "WF28D");
I expect that the array will need to be in RAM not ROM so it can't be "const" as the constructor declaration doesn't use const. It isn't a big loss on a MBED though.
PS I understand that BusOut is notoriously slow and you may actually get faster data transfer with SPI, especially as some versions of the library can use DMA transfers.
Thanks, but you have one error: PinName[16], thta's right: PinName dataBus[16]. It works!
posted by 11 Jun 2016OK yeah I got the array syntax wrong, oops. I'll correct it down here in case anyone wants to copy-paste.
PinName dataBus[16] = { PA_5, PA_3, PA_2, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15 }; ILI9341 disp(BUS_16, dataBus, PA_13, PA_14, PA_12, PA_11, PA_8, "WF28D");
You'll probably have to give more information like who's library you are trying to use and what platform you are compiling for.
posted by Oliver Broad 11 Jun 2016There's UniGraphic library and nucleo f080 board.
posted by Anatoly Zimin 11 Jun 2016