Somebody asked for me to post my source code.
Spoiler
int button=0;
int set=1;
int mode=1;
int red=62;
int blue=63;
int red_button=64;
int blue_button=65;
int red_LED=66;
int blue_LED=67;
int red_on_done=0;
int red_off_done=0;
int blue_on_done=0;
int blue_off_done=0;
int x=0;
int setting=1;
unsigned long time1;
unsigned long time2;
unsigned long time3;
unsigned long time4;
unsigned long time5;
unsigned long time6;
unsigned long time7;
int long red_on=00000;
int long red_off=16666;
int long blue_on=00000;
int long blue_off=1000;
int long cycle = 500250;
int skip = 00000;
#include “SPI.h”
#include “Adafruit_GFX.h”
#include “Adafruit_ILI9341.h”
#include “Wire.h” // this is needed for FT6206
#include “Adafruit_FT6206.h”
// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
#define SD_CS 4
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
Adafruit_FT6206 ctp = Adafruit_FT6206();
int cs_pin=53;
void setup() {
pinMode(cs_pin,OUTPUT);
tft.begin();
ctp.begin();
tft.setTextColor(ILI9341_WHITE); tft.setTextSize(2);
tft.setRotation(0);
tft.fillScreen(ILI9341_BLUE);
tft.fillRect(0,140,120,120,ILI9341_RED);
tft.fillRect(120,140,120,120,ILI9341_BLUE);
tft.fillRect(0,250,240,120,ILI9341_BLACK);
tft.fillRect(0,0,240,140,ILI9341_BLACK);
tft.drawRect(0,0,40,70,ILI9341_WHITE);
tft.drawRect(40,0,40,70,ILI9341_WHITE);
tft.drawRect(80,0,40,70,ILI9341_WHITE);
tft.drawRect(120,0,40,70,ILI9341_WHITE);
tft.drawRect(160,0,40,70,ILI9341_WHITE);
tft.drawRect(200,0,40,70,ILI9341_WHITE);
tft.drawRect(0,70,40,70,ILI9341_WHITE);
tft.drawRect(40,70,40,70,ILI9341_WHITE);
tft.drawRect(80,70,40,70,ILI9341_WHITE);
tft.drawRect(120,70,40,70,ILI9341_WHITE);
tft.drawRect(160,70,40,70,ILI9341_WHITE);
tft.drawRect(200,70,40,70,ILI9341_WHITE);
//tft.drawRect(0,140,120,120,ILI9341_BLUE);
//tft.drawRect(0,60,120,60,ILI9341_BLUE);
//tft.drawRect(0,120,120,60,ILI9341_WHITE);
//tft.drawRect(120,0,120,60,ILI9341_RED);
//tft.drawRect(120,60,120,60,ILI9341_RED);
//tft.drawRect(120,120,120,60,ILI9341_WHITE);
pinMode(blue,OUTPUT);
pinMode(red,OUTPUT);
pinMode(red_button,OUTPUT);
pinMode(blue_button,OUTPUT);
pinMode(red_LED,OUTPUT);
pinMode(blue_LED,OUTPUT);
digitalWrite(red_button,HIGH);
digitalWrite(blue_button,HIGH);
digitalWrite(blue,HIGH);
digitalWrite(red,HIGH);
digitalWrite(red_LED,HIGH);
digitalWrite(blue_LED,HIGH);
tft.setCursor(1,141);
tft.print(“ON”);
tft.setCursor(1,171);
tft.print(red_on);
tft.setCursor(1,201);
tft.print(“OFF”);
tft.setCursor(1,231);
tft.print(red_off);
tft.setCursor(1,271);
tft.print(“CYCLE”);
tft.setCursor(1,301);
tft.print(cycle);
tft.setCursor(121,141);
tft.print(“ON”);
tft.setCursor(121,171);
tft.print(blue_on);
tft.setCursor(121,201);
tft.print(“OFF”);
tft.setCursor(121,231);
tft.print(blue_off);
tft.setCursor(121,271);
tft.print(“SKIP”);
tft.setCursor(121,301);
tft.print(skip);
}
void loop() {
if (mode==1){if ((time2)<(micros())){
time1=micros();skip=0;mode=2;}}
if(mode==2){
if ((micros()>time2+red_on) && red_on_done==0){time3=micros();digitalWrite(red_LED,HIGH);digitalWrite(red,LOW);digitalWrite(red_button,HIGH);red_on_done=1;}
if ((micros()>time2+blue_on) && blue_on_done==0){time4=micros();digitalWrite(blue_LED,HIGH);digitalWrite(blue,LOW);digitalWrite(blue_button,HIGH); blue_on_done=1;}
if ((micros()>time2+red_off) && red_off_done==0){time5=micros();digitalWrite(red_LED,LOW);digitalWrite(red,HIGH);digitalWrite(red_button,LOW);red_off_done=1;}
if ((micros()>time2+blue_off) && blue_off_done==0){time6=micros();digitalWrite(blue_LED,LOW);digitalWrite(blue,HIGH);digitalWrite(blue_button,LOW);blue_off_done=1;}
if(micros()>time2+60000){mode=3;}
}
if(mode==3){
if (ctp.touched())
{
TS_Point p = ctp.getPoint(); // x = 240, y= 320
if(p.x>200){if(button==0){
if(p.y>250 && p.y>180){set++;}
if(p.y<250){set–;}
if(set<1){set=6;}
if(set>6){set=1;}
tft.setCursor(2,30);tft.fillRect(2,30,20,20,ILI9341_BLACK);tft.print(set);}}
if(p.y>180){
if(button==0){x=0;
if(p.x>0 && p.x<40 && p.y>180 && p.y<250){x=x-1;}
if(p.x>0 && p.x<40 && p.y>250 && p.y<320){x=x+1;}
if(p.x>40 && p.x<80 && p.y>180 && p.y<250){x=x-10;}
if(p.x>40 && p.x<80 && p.y>250 && p.y<320){x=x+10;}
if(p.x>80 && p.x<120 & p.y>180 && p.y<250){x=x-100;}
if(p.x>80 && p.x<120 & p.y>250 && p.y<320){x=x+100;}
if(p.x>120 && p.x<160 & p.y>180 && p.y<250){x=x-1000;}
if(p.x>120 && p.x<160 & p.y>250 && p.y<320){x=x+1000;}
if(p.x>160 && p.x<200 & p.y>180 && p.y<250){x=x-10000;}
if(p.x>160 && p.x<200 & p.y>250 && p.y<320){x=x+10000;}
if (set==1){red_on=red_on+x;
if (red_on>50000){red_on=50000;}
if (red_on<0){red_on=0;}
tft.fillRect(0,171,120,20,ILI9341_RED);
tft.setCursor(1,171);
tft.print(red_on);}
if (set==2){ red_off=red_off+x;
if (red_off>50000){red_off=50000;}
if (red_off<0){red_off=0;}
tft.fillRect(0,231,120,20,ILI9341_RED);
tft.setCursor(1,231);
tft.print(red_off);}
if(set==3){ cycle=cycle+x;
if (cycle>1999999){cycle=1999999;}
if (cycle<100000){cycle=100000;}
tft.fillRect(1,301,110,20,ILI9341_BLACK);
tft.setCursor(1,301);
tft.print(cycle);}
if (set==4){blue_on=blue_on+x;
if (blue_on>50000){blue_on=50000;}
if (blue_on<0){blue_on=0000;}
tft.fillRect(121,171,120,20,ILI9341_BLUE);
tft.setCursor(121,171);
tft.print(blue_on);}
if(set==5){blue_off=blue_off+x;
if (blue_off>50000){blue_off=50000;}
if (blue_off<0){blue_off=0000;}
tft.fillRect(121,231,120,20,ILI9341_BLUE);
tft.setCursor(121,231);
tft.print(blue_off);}
if(set==6){skip=x;
tft.fillRect(121,301,120,20,ILI9341_BLACK);
tft.setCursor(121,301);
tft.print(skip); }
button=1;
tft.fillRect(2,100,130,20,ILI9341_BLACK);tft.setCursor(2,100);
tft.print(time5-time3);//tft.print("-");//tft.print(time4-time3);
}}}
else
{button=0;}
red_on_done=0;
red_off_done=0;
blue_on_done=0;
blue_off_done=0;
time2=time1+cycle+skip;mode=1;}
}