Hi,
Here is a small edit to add touch tags.
It displays the touch tag, and the x and y coordinates.
The X and Y will read 32768 when not touched indicating a pen-up condition. They will show the coordinates of the touch when present.
The tag will show 0 if there is no touch, and 100 if touched on a non-tagged area (see code line CLEAR_TAG(100) where we set this).
It will show 1, 2 or 3 if you touch the respective image on the screen.
There are several ways to implement touch including interrupts but this shows one way to poll the touch and is quite easy to add to your code.
Some browsers don't work with the FTP links and so if using Windows 10 you can search for 'Internet Explorer' in Windows 10 search (even if not your main browser) and paste the FTP link into the browser. Windows 10 behaviour has changed as now Edge and Chrome browsers do not allow FTP download without an external FTP Client.
Best Regards, BRT Community
while(1)
{
// Create screen
EVE_LIB_BeginCoProList();
EVE_CMD_DLSTART();
EVE_CLEAR_COLOR_RGB(255, 255, 255); // colour of the background of the screen
EVE_CLEAR_TAG(100); // tag value of any un-tagged areas of screen
EVE_CLEAR(1,1,1); // clear all
EVE_COLOR_RGB(255,255,255); // set white to ensure images display in their original colours
EVE_TAG_MASK(1); // enable tagging
EVE_BEGIN(EVE_BEGIN_BITMAPS);
EVE_TAG(1); // this image will be tagged with 1
EVE_CMD_SETBITMAP(0, EVE_FORMAT_ARGB1555, 240, 114);
EVE_VERTEX2F((20*16),(100*16));
//EVE_END();
//EVE_BEGIN(EVE_BEGIN_BITMAPS);
EVE_TAG(2); // this image will be tagged with 2
EVE_CMD_SETBITMAP(80000, EVE_FORMAT_ARGB1555, 240, 114);
EVE_VERTEX2F((280*16),(100*16));
//EVE_END();
//EVE_BEGIN(EVE_BEGIN_BITMAPS);
EVE_TAG(3); // this image will be tagged with 3
EVE_CMD_SETBITMAP(0x800000 | 66496 / 32, EVE_FORMAT_COMPRESSED_RGBA_ASTC_4x4_KHR, 240, 114);
EVE_VERTEX2F((540*16),(100*16));
EVE_END();
EVE_TAG_MASK(0); // disable tagging
// Add the description text
EVE_COLOR_RGB(0, 0, 255);
EVE_CMD_TEXT(20 + (240/2), 240, 28, EVE_OPT_FORMAT | EVE_OPT_CENTER, "Raw Image \n Copied to RAM_G");
EVE_CMD_TEXT(280 + (240/2),240, 28, EVE_OPT_FORMAT | EVE_OPT_CENTER, "Bin Image \n Inflated to RAM_G");
EVE_CMD_TEXT(540 + (240/2),240, 28, EVE_OPT_FORMAT | EVE_OPT_CENTER, "ASTC Image \n Direct from Flash");
// print the tag number and coordinates
EVE_COLOR_RGB(255, 0, 0);
EVE_CMD_TEXT(20, 300, 28, EVE_OPT_FORMAT, "Tag is %d ", TagVal);
EVE_CMD_TEXT(20, 340, 28, EVE_OPT_FORMAT, "X is %d ", TouchX);
EVE_CMD_TEXT(20, 380, 28, EVE_OPT_FORMAT, "Y is %d ", TouchY);
EVE_DISPLAY();
EVE_CMD_SWAP();
EVE_LIB_EndCoProList();
EVE_LIB_AwaitCoProEmpty();
// read the tracker coordinates
TagVal = HAL_MemRead8(EVE_REG_TOUCH_TAG);
TouchXY = HAL_MemRead32(EVE_REG_TOUCH_SCREEN_XY);
TouchY = (TouchXY & 0x0000FFFF);
TouchX = ((TouchXY & 0xFFFF0000) >> 16);
}