Yeah for sure. Lets see.
First if you go to line 7754 in display sketch you'll see the following 3 lines.
Code:
myTouch.read();
x = myTouch.getX();
y = myTouch.getY();
Add these 4 lines after the above lines. With this done you can open the serial window on the Arduino IDE and get the coordinates of the screen when you touch.
Code:
Serial.print("x = ");
Serial.println(x);
Serial.print("y = ");
Serial.println(y);
For the shortcuts on the home page, look for line 7761, just a few lines down from the above code.
You'll see "case 1:"
Everything under "case 1:" is the touch code for the home page. When you hit "case 2:" that's the next page which is feeding. Every page has a case number for the touch code.
Now go to line 1646, you'll see.
this is the home screen.
Now scroll through the code and you'll come to
Code:
void screenFeeding()
{
this is the feeding screen. If you put your cursor in front of the open bracket on line 2 from above you can scroll down and you'll see the closing bracket is kinda highlighted. This is good to find the end of the function.
At the end you'll see the beginning of a new page.
So anytime you want to load a new page you need to call the function name for the page you want to load.
For example we want to load the home page we would use the following code.
If we want to load the feeding page we use
The code to load the light settings page is
Once you find the names of the pages you want to load we need to add this to the touch section for the home page, this is "case 1:" on line 7761 as described above.
In this case section you add the code for the extra buttons. It's best to add it to the bottom of the section, if you find "case 2:" on line 7987 you have the end of the section.
The last line of each case section has
followed by the new case number. You want to add the extra buttons just above the break.
For example the last button on the home page is the following.
Code:
else if ((x >= 650) && (x <= 799) && (y >= 54) && (y <= 359))
{
screenPower();
}
Every new button is the same code, copy and paste any button and change the page inside you want to call. You can see that button is loading the "Power Screen", if you changed that to screenLights(); you would get the lights settings page.
You also have to change the X and Y coordinates in the "else if" to the proper coordinates.
With the display plugged in your computer and the serial window in the Arduino IDE open you can get the coordinates by touching the top left corner and the bottom right corner of the button. Then replace the numbers and you should be good.
Well I hope that all makes sense, let me know.