Excellent work... Willie and Fernando
Do you have a link to the 7 inch screen you are using ?
If I have an 800 x 480 5 inch screen I am going to assume it will display the same as the 7 inch screen right ?
const byte temM[]= {
90*2, 35*2, 115*2, 60*2}; // temp. minus
Hi!
Willie, you no need change all coordinates of buttons manually.
Use the tool "find and replace" on this tab:
https://github.com/willie111/Ferdui...uino_with_webcontrol_beta7_0/Botoes_e_etc.ino
Find:
comma space
Replace with:
* 2 comma space
Then
Find:
};
Replace with:
*2};
The result will be as this:
Code:const byte temM[]= { 90*2, 35*2, 115*2, 60*2}; // temp. minus
Best regards.
if (setFont) {
myGLCD.setFont(BigFont);
fx = x1+(((x2 - x1+1)-(stl*16))/2);
fy = y1+(((y2 - y1+1)-16)/2);
myGLCD.print(text, fx, fy);
}
else {
myGLCD.setFont(RusFont1);
fx = x1+(((x2 - x1)-(stl*8))/2);
fy = y1+(((y2 - y1-1)-6)/2);
myGLCD.print(text, fx, fy);
}
myGLCD.setFont(BigFont);
fx = x1+(((x2 - x1+1)-(stl*16))/2);
fy = y1+(((y2 - y1+1)-16)/2);
myGLCD.print(text, fx, fy);
Fernando's control code on a 7" screen is going to be next big thing for DIY
If you'll use always a big font to texts on buttons.
Find:
https://github.com/willie111/Ferdui...with_webcontrol_beta7_0/Botoes_e_etc.ino#L232
Code:if (setFont) { myGLCD.setFont(BigFont); fx = x1+(((x2 - x1+1)-(stl*16))/2); fy = y1+(((y2 - y1+1)-16)/2); myGLCD.print(text, fx, fy); } else { myGLCD.setFont(RusFont1); fx = x1+(((x2 - x1)-(stl*8))/2); fy = y1+(((y2 - y1-1)-6)/2); myGLCD.print(text, fx, fy); }
Replace with:
Code:myGLCD.setFont(BigFont); fx = x1+(((x2 - x1+1)-(stl*16))/2); fy = y1+(((y2 - y1+1)-16)/2); myGLCD.print(text, fx, fy);
myGLCD.setBackColor(0, 0, 200);
//if (setFont) {
myGLCD.setFont(BigFont);
fx = x1+(((x2 - x1+1)-(stl*16))/2);
fy = y1+(((y2 - y1+1)-16)/2);
myGLCD.print(text, fx, fy);
/* }
else {
myGLCD.setFont(RusFont1);
fx = x1+(((x2 - x1)-(stl*8))/2);
fy = y1+(((y2 - y1-1)-6)/2);
myGLCD.print(text, fx, fy);
}*/
}
printButton(buffer, tanD[0], tanD[1], tanD[2], tanD[3], true);
void mainScreen(boolean refreshAll=false)
{
int ledLevel, s, u;
String oldval, rtc1, rtcm, oldano;
oldval = day;
oldano = ano;
int Hour12;
String ampm;
day = String(t.date); //Atualiza se a data for diferente
ano = String(t.year);
int offset = 0;
setFont(LARGE, 255, 255, 0, 0, 0, 0);
// myGLCD.print(rtc.getTimeStr(FORMAT_LONG), 630, 454);
{
if (t.hour==0) { Hour12 = 12; } //12 HR Format
else {
if (t.hour>12) { Hour12 = t.hour-12; }
else { Hour12 = t.hour; }}
if (Hour12<10)
{ myGLCD.print(" ", 652, 454);
myGLCD.printNumI(Hour12, 668, 454);}
else
{ myGLCD.printNumI(Hour12, 652, 454);}
myGLCD.print(":", 684, 454);
if (t.min<10)
{ myGLCD.printNumI(0, 700, 454);
myGLCD.printNumI(t.min, 716, 454);}
else
{ myGLCD.printNumI(t.min, 700, 454);}
setFont(LARGE, 0, 0, 255, 0, 0, 0);
if(t.hour < 12){ myGLCD.print(" AM ", 732, 454); } //Adding the AM/PM sufffix
else { myGLCD.print(" PM ", 732, 454); }
}
Willie you might like to use this piece of code for am and pm time located in the
Inicio
Code:void mainScreen(boolean refreshAll=false) { int ledLevel, s, u; String oldval, rtc1, rtcm, oldano; oldval = day; oldano = ano; int Hour12; String ampm; day = String(t.date); //Atualiza se a data for diferente ano = String(t.year); int offset = 0; setFont(LARGE, 255, 255, 0, 0, 0, 0); // myGLCD.print(rtc.getTimeStr(FORMAT_LONG), 630, 454); { if (t.hour==0) { Hour12 = 12; } //12 HR Format else { if (t.hour>12) { Hour12 = t.hour-12; } else { Hour12 = t.hour; }} if (Hour12<10) { myGLCD.print(" ", 652, 454); myGLCD.printNumI(Hour12, 668, 454);} else { myGLCD.printNumI(Hour12, 652, 454);} myGLCD.print(":", 684, 454); if (t.min<10) { myGLCD.printNumI(0, 700, 454); myGLCD.printNumI(t.min, 716, 454);} else { myGLCD.printNumI(t.min, 700, 454);} setFont(LARGE, 0, 0, 255, 0, 0, 0); if(t.hour < 12){ myGLCD.print(" AM ", 732, 454); } //Adding the AM/PM sufffix else { myGLCD.print(" PM ", 732, 454); } }
comment out myGLCD.print(rtc.getTimeStr(FORMAT_LONG), 630, 454);
redtop03 after you get this all done any idea what your going to use as an enclosure??