Basic Arduino Touch Demo

FTDI/Bridgetek EVE2 & EVE3 & EVE4 SPI TFT Series by Matrix Orbital

Moderator: Mods

Post Reply
prestonpressure
LCD?
Posts: 8
Joined: Tue Apr 05, 2022 1:52 pm

Basic Arduino Touch Demo

Post by prestonpressure »

I am unable to get a minimal Arduino touch screen to function. I am using an EVE4 Capacitive touch, 7" screen. The libraries I am using are from here viewtopic.php?f=45&t=6918
I have removed all the unused display demo lines in the above linked program and replaced them with this. Can anyone suggest why this is not working?

void MakeScreen_MatrixOrbital(uint8_t R, uint8_t G,uint8_t B) //Fuction that will draw lines and display text
{
Send_CMD(CMD_DLSTART); //Start a new display list
Send_CMD(VERTEXFORMAT(0)); //Setup VERTEX2F to take pixel coordinates
Send_CMD(CLEAR_COLOR_RGB(0, 0, 0)); //Determine the clear screen color
Send_CMD(CLEAR(1, 1, 1)); //Clear the screen and the curren display list
Send_CMD(COLOR_RGB(255, 255, 255));//Change color to white for text
Cmd_Text(300, 10, 28,0, "Button Touch Test"); //Write text on top of the screen

// Draw Menu Button
Send_CMD(TAG(1)); //Tag the button with a touch ID
Cmd_Button(350, 300, 75, 40, 22,0,"TOUCH" );//Button (x,y,length,width,font,options,text)
// Send_CMD(TAG(1)); //Tag the button with a touch ID

Tag = rd8(REG_CTOUCH_TAG + RAM_REG);//Check for touches Programming Guide Page 43

Cmd_Number(390, 200, 25, OPT_RIGHTX, Tag); //display Tag value

Send_CMD(END()); //End drawing point
Send_CMD(DISPLAY()); //End the display list
Send_CMD(CMD_SWAP); //Swap commands into RAM
UpdateFIFO(); //Trigger the CoProcessor to start processing the FIFO
}

void setup() //run once, setup
{
GlobalInit(); //EVE display interface initialization
FT81x_Init(); //Reset and initialize the EVE
wr8(REG_PWM_DUTY + RAM_REG,128); //Set the backlight to full brightness
}

void loop() //main loop
{
MakeScreen_MatrixOrbital(0, 0, 255);//update display
delay(100);
// Tag = rd8(REG_CTOUCH_TAG + RAM_REG);//Check for touches Programming Guide Page 43
}

prestonpressure
LCD?
Posts: 8
Joined: Tue Apr 05, 2022 1:52 pm

Re: Basic Arduino Touch Demo

Post by prestonpressure »

Resolved. My primary problem was that the capacitive touch feature needed to be turned On with this line:
wr16(REG_TOUCH_CONFIG + RAM_REG, 0x5d0); //Capacitive touch screen on

More information can be seen here:
viewtopic.php?f=45&t=6966

Post Reply