TFT_ILI9341 with two displays

I'm using the Bodmer TFT_ILI9341 library found here, GitHub - Bodmer/TFT_ILI9341: A fast Arduino IDE compatible graphics and fonts library including a driver for the ILI9341 based TFT displays. . What I'm trying to do is write different information to two separate 2.8" TFT displays. Since the CS pin is defined in the User_Setup file, not in the Arduino sketch, I'm baffled. How would I do this?
I posted the same question on Github, but no response.

Modify the library so that you pass the pins you want to use to the object's constructor.

Can you give me an example. I am VERY new to Arduino programming

1 Like

With what arduino board?
There are not a much Arduinos, that have an enough memory to work with two TFT

I am afraid that the task is too complicated for beginner

I'm using an Arduino Mega 2560, so plenty of memory. Also it's only complicated if one doesn't understand. One understands by learning and with help from those that do understand, they learn and then they also understand.

b707, your reply was not only of no help, it was an insult.

I am afraid you are mistaken.
The Mega is a old board with a very limited memory. The only benefit it has is a lot of GPIOs, what could be helpful to connect two displays.
But if you think that Mega is suitable for the project, then it is so.
Good luck.

The Adafruit ILI9341 library allows one to specify the DC and CS pins.

1 Like

b707
Yep, the Mega is old, but it works and I have several. When I said plenty of memory, I really meant plenty for my project.

groundFungus
Love your username. I thought about using the Adafruit libraries, but I'm opting for the Bodmer library because it is so much faster.

I might try to manually control the CS pins with code. Seems like a awkward way to do it, but it might be worth a shot. Any thoughts on that?

You can create your own clone of the Bodmer library and add CS pin to the display object parameters (as suggested in #2)

Update:
I set the CS pin in the Bodmer library to an unused Arduino pin and controlled the CS pin of each display independently with software and it worked great.
Thanks for all the suggestions.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.