OK here goes. It's over 9000 characters long, so might have to break it up.
// IMPORTANT: LCDWIKI_KBV LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
#include <LCDWIKI_GUI.h> //Core graphics library
#include <LCDWIKI_KBV.h> //Hardware-specific library
#include <LCDWIKI_TOUCH.h>
#include "font.h"
LCDWIKI_KBV my_lcd(ILI9486, 40, 38, 39, 44, 41); //model,cs,cd,wr,rd,reset
LCDWIKI_TOUCH my_touch(53, 52, 50, 51, 44); //tcs,tclk,tdout,tdin,tirq
#define BLACK 0x0000
#define BLUE 0x001F
#define LIGHTBLUE 0x010D
#define RED 0xF800
#define GREEN 0x07E0
#define DARKGREEN 0x0700
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define ORANGE 0xFF00
#define YELLOW 0xFFC0
#define WHITE 0xFFFF
int shX = 30;
int shY = 0;
float sFc = 1.3;
int trZoom = 0;
char buff[60];
char *commandString[5] = {"Hello", "Welcome to the program", "System ready", "Please enter first commands", "#"};
char *commandWords[25] = {"Print", "Join", "Name", "Revise", "Copy", "List", "Go To", "Play", "Cycle", "Delete", "Title", "Mix", "Cue", "Event", "Drop In", "Setup", "Preset", "Reel", "Track", "Sync", "End", "From", "Here", "To", "At"};
char *commandKeyboardString[25] = {" PRINT", " JOIN", " NAME", "REVISE", " COPY", " LIST", " GO TO", " PLAY", " CYCLE", "DELETE", " TITLE", " MIX", " CUE", " EVENT", "DROP IN", "SET UP", "PRESET", " REEL", " TRACK", " SYNC", " END", " FROM", " HERE", " TO", " AT"};
char *keypadString[50] = {"!", "''", "#", "?", "&", "+", "-", "(", ")", ":", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "A", "S", "D", "F", "G", "H", "J", "K", "L", "*", "Z", "X", "C", "V", "B", "N", "M", "'", ".", " "};
int knobX[30] = {19, 19, 19, 82, 109, 82, 109, 82, 82, 109, 82, 146, 173, 146, 173, 146, 146, 173, 146, 173, 146, 209, 209, 209, 209, 209, 209, 209, 301, 301};
int knobY[30] = {130, 156, 182, 15, 33, 51, 69, 87, 121, 169, 182, 15, 30, 44, 59, 73, 102, 116, 131, 146, 160, 15, 42, 69, 96, 123, 150, 182, 121, 159};
int knobCol[30] = {BLUE, BLUE, RED, BLUE, BLUE, BLUE, DARKGREEN, DARKGREEN, DARKGREEN, BLUE, BLUE, RED, RED, DARKGREEN, DARKGREEN, DARKGREEN, BLUE, BLUE, BLUE, ORANGE, ORANGE, BLUE, BLUE, BLUE, BLUE, BLUE, BLUE, RED, BLUE, BLUE};
int knobPosX[25] = { -5, -6, -7, -7, -7, -7, -7, -6, -5, -3, -2, -1, 0, 1, 2, 3, 5, 6, 7, 7, 7, 7, 7, 6, 5};
int knobPosY[25] = { -5, -3, -2, -1, 0, 1, 2, 3, 5, 6, 6, 7, 7, 7, 6, 6, 5, 3, 2, 1, 0, -1, -2, -3, -5};
int routingButton[72] = {6, 8, 21, 8, 36, 8, 51, 8, 6, 20, 21, 20, 36, 20, 51, 20, 6, 32, 21, 32, 36, 32, 51, 32, 6, 44, 21, 44, 36, 44, 51, 44, 6, 56, 21, 56, 36, 56, 51, 56, 6, 68, 21, 68, 36, 68, 51, 68, 6, 80, 21, 80, 36, 80, 51, 80, 6, 92, 21, 92, 36, 92, 51, 92, 6, 104, 21, 104, 36, 104, 51, 104};
int switchButton[58] = {39, 125, 39, 145, 39, 158, 39, 171, 39, 184, 102, 6, 102, 87, 102, 182, 166, 6, 166, 76, 166, 89, 166, 160, 229, 17, 229, 30, 229, 58, 229, 71, 229, 85, 229, 98, 229, 112, 229, 125, 229, 139, 229, 152, 229, 171, 229, 184, 293, 60, 293, 73, 293, 86, 293, 99, 293, 133};
int dyneqButton[12] = {74, 139, 90, 139, 106, 139, 138, 177, 154, 177, 170, 177};
int eaoSwitch[12] = {262, 4, ORANGE, 291, 4, DARKGREEN, 262, 174, YELLOW, 291, 174, RED};
int knobSetVal[30] = {0, 0, 150, 0, 0, 0, 100, 0, 0, 0, 0, 0, 700, 700, 0, 0, 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256};
int knobTempVal[30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int knobCurVal[30] = {500, 500, 500, 500, 500, 500, 500, 500, 500, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50};
int routingButtonSetVal[36] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int routingButtonTempVal[36] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int routingButtonCurVal[36] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int switchButtonSetVal[29] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int switchButtonTempVal[29] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int switchButtonCurVal[29] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int dyneqButtonSetVal[6] = {0, 0, 0, 0, 0, 0};
int dyneqButtonTempVal[6] = {0, 0, 0, 0, 0, 0};
int dyneqButtonCurVal[6] = {0, 0, 0, 0, 0, 0};
int eaoSwitchSetVal[4] = {0, 0, 0, 0};
int eaoSwitchTempVal[4] = {0, 0, 0, 0};
int eaoSwitchCurVal[4] = {0, 0, 0, 0};
int smallFaderSetVal = 0;
int smallFaderTempVal = 0;
int smallFaderCurVal = 50;
int knobThresh = 4;
int knobPos = 0;
int routingThresh = 5;
int faderThresh = 5;
int dyneqThresh = 5;
int eaoThresh = 5;
int activeItem = 1;
int activeCursor = 1;
int screen = 1;
int prevScreen = 1;
int screenSaver = 0;
long screenSaverCount = 0;
int screenCommandKeyboard = 0;
int screenKeypadFlag = 0;
uint16_t px, py;
boolean is_pressed(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t px, int16_t py)
{
if ((px > x1 && px < x2) && (py > y1 && py < y2))
{
return true;
}
else
{
return false;
}
}
void setup() { //---------------------------------------------------setup----------------------------------------------------------
my_lcd.Init_LCD();
my_lcd.Set_Rotation(1);
my_touch.TP_Init(3, 479, 319);
my_lcd.Set_Text_Size(1);
my_lcd.Set_Text_Mode(0);
my_lcd.Set_Text_colour(GREEN);
my_lcd.Set_Text_Back_colour(BLACK);
my_lcd.Fill_Screen(BLACK);
for (int i = 0; i < 30; i++) {
knobCurVal[i] = knobTempVal[i];
}
screenSplash();
splashLoading();
screenHeader();
screenList();
my_lcd.Set_Text_Size(2);
my_lcd.Set_Text_colour(GREEN);
my_lcd.Set_Text_Back_colour(BLACK);
my_lcd.Print_String(">", 460, 300);
my_lcd.Set_Text_Size(1);
}
void loop() { //---------------------------------------------------loop----------------------------------------------------------
px = 0;
py = 0;
my_touch.TP_Scan(0);
if (my_touch.TP_Get_State()&TP_PRES_DOWN)
{
px = my_touch.x;
py = my_touch.y;
screenSaverCount = 0;
if (screenSaver == 1) { //RELAUNCH LAST SCREEN IF IN SCREENSAVER MODE
shX = 30;
shY = 0;
sFc = 1.333;
trZoom = 0;
switchScreen();
screenSaver = 0;
}
else {
touchedScreen();
}
}
screenSaverCount = screenSaverCount + 1;
if (screenSaverCount >= 10000000 && screenSaver == 0) {
screenSplash();
screenSaver = 1;
}
}