Hello. I need connect 2 spi displays to arduino. Im using UTFT library. I need somehow select screen for printing information.
Give each screen a different Slave Select pin and select the required screen before writing to it
Im trying, but i don't know how to select screen in script. i'm not bound to UTFT library, but i found nothing about screen selection in google.
Read How to get the best out of this forum
Follow the advice and post your complete sketch using code tags
I have no code. Becouse i don't understand how to select the screen. that's why im here
Find an example that uses one screen and get that working then post the working code here asking for advice on adding a second screen. Do not start a new topic for the question
Ok, here it is.
#include <UTFT.h>
#define SDI 11
#define SCK 13
#define CS 10
#define RESET 7
#define DC 8
UTFT s1(ILI9341_S5P,SDI,SCK,CS,RESET,DC);
void setup(){
s1.InitLCD(); }
byte space = 2;
void loop(){
s1.setColor(VGA_WHITE);
for (int i = 0; i<5; i++)
{
s1.drawCircle(160,120,90-i*space);
}
s1.setColor(VGA_BLACK);
for (int i = 0; i<5; i++)
{
s1.drawCircle(160,120,90-i*space);
}
}
UTFT s1(ILI9341_S5P,SDI,SCK,CS,RESET,DC);
The value of CS in that statement sets the address of the display. If you were to do
#include <UTFT.h>
#define SDI 11
#define SCK 13
#define CS1 10
#define CS1 4
#define RESET 7
#define DC 8
UTFT s1(ILI9341_S5P,SDI,SCK,CS1,RESET,DC);
UTFT s2(ILI9341_S5P,SDI,SCK,CS2,RESET,DC);
then you could print to either screen s1 or screen s2 independently if you connect the CS pin of screen 2 to pin 4 or another otherwise unused pin
nope, in this case, they are not working at all.
upd: sometimes it works, but only with last inicialised screen.
i must use :
s1.InitLCD();
s2.InitLCD();
and only last inicialised screen will work.
Try giving each screen a different reset pin
I tryed. different rst/cs/dc in different combinations. but nothing changed
Each screen shares the same SDA and SCL pins and needs its own CS pin but I am not sure about the RST pin. The RS (DC) pin is optional depending on the display being used
Can you please post a link to the screens being used ? I assume the both of them work when used with the single screen sketch
It is?
POOH !
Did I really post that ?
It should, of course, be
#define CS1 10
#define CS2 4
@classic_fungus take note of the change and try 2 screens again each using different CS pins
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.