You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Play/my719/readprognoz.ino

1027 lines
27 KiB

void readprognoz()
{ char* name;
myGLCD.setFont( Ubuntubold);
myGLCD.setBackColor( VGA_TRANSPARENT);
myGLCD.setColor(VGA_WHITE);
sd.chdir("/");
delay (100);
if (!sd.chdir("progn"))
{return;
}
delay (100);
sd.chdir("progn");
delay (100);
myFile.open("pr.raw", O_READ);
byte bait;
byte bait1;
int years2;
byte pmon;
byte pdat;
byte dow1;
int n=0;
int m=0;
int w;
for (int i =0 ; i < 76800; i = i++)
{
n=n+1;
bait = myFile.read();
bait1 =myFile.read();
w= bait<<8|bait1;
pic1[n]=w;
//3199
if (n>319)
{
n=0;
// myGLCD.drawBitmap (0, 20*m, 320, 10, pic1, 2);
myGLCD.drawBitmap (0, 2*m, 320, 1, pic1, 2);
m=m+1;
}
}
// close the file:
myFile.close();
delay (200);
//********************************************************
stops:
if(wifi==20)
{ sd.chdir("/");
delay (100);
while( n < 6)
{myGLCD.setColor(VGA_WHITE);
myGLCD.print(" BAD DATE ",220, 184);
delay (1000);
myGLCD.setColor(VGA_BLUE);
myGLCD.print(" BAD DATE ",220, 184);
delay (1000);
n++;
}
rawp=0;
return;
}
if(wifi==9)
{myGLCD.setColor(VGA_RED);
}
else
{myGLCD.setColor(VGA_WHITE);
}
myGLCD.setFont(BigFont);
myGLCD.printNumI(wifih, 285, 455);
myGLCD.print(":" ,285+32, 455);
if (wifim<10)
{myGLCD.print("0" ,285+48, 455);
myGLCD.printNumI(wifim, 285+48+16, 455);
}
else
{myGLCD.printNumI(wifim, 285+32+16, 455);
}
myGLCD.setColor(VGA_WHITE);
myGLCD.setFont( Ubuntubold);
// Маска, по которой мы ищем название иконки
//const char token[] = "icon=\"???";//<time day="2014-10-12"> icon="03d"
char token[] = "time day=\"??????????";
// Сюда будет сохраняться номер иконки из ответа API
char imageId[6] = "nomer";
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
if (sd.exists("prognoz.txt"))
{name= "prognoz.txt";
}//установка раб директории
else
{name= "prognoz1.txt";
}
myFile.open(name, O_READ);
byte nd=0;
byte flmon=0;
//myGLCD.print("Prognoz na",40, 20);
char symbol;
int i = 0, j = 0;
int ss=0;
// while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
ss++;
if(ss>10000)
{ss=0;
nd=50;
}
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token[i] || token[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token[i] == '?') && (j < 10)) {
imageId[j] = symbol;
if (j==0)
years2=1000*(symbol-48);//перевод символа в число год*1000+ед мес
if (j==1)
years2=years2+100*(symbol-48);
if (j==2)
years2=years2+10*(symbol-48);
if (j==3)
years2=years2+(symbol-48);
if (j==5)
pmon=10*(symbol-48);//перевод символа в число мес*10+ед мес
if (j==6)
pmon=pmon+(symbol-48);
if (j==8)
pdat=10*(symbol-48);//перевод символа в число дата*10+ед даты
if (j==9)
pdat=pdat+(symbol-48);
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==10)
{
dow1=calcDOW(pdat, pmon, years2);
if (dow1>5)
{myGLCD.setColor(251, 81, 68);
}
else
{myGLCD.setColor(255, 255, 255);
}
myGLCD.setFont( Ubuntubold);
if (pdat<10)
{ myGLCD.print(".",14+38, 40+69*nd);
myGLCD.print("0",14, 40+69*nd);
myGLCD.printNumI(pdat,14+24, 40+69*nd);
}
else
{myGLCD.print(".",14+38, 40+69*nd);
myGLCD.printNumI(pdat,14, 40+69*nd);
}
if (pmon<10)
{ myGLCD.print("0",14+38+18, 40+69*nd);
myGLCD.printNumI(pmon,14+38+18+24, 40+69*nd);
}
else
{myGLCD.printNumI(pmon,14+38+18, 40+69*nd);
}
myGLCD.setFont(BigFont);
myGLCD.print(str[dow1-1], 14+24, 71+69*nd);
nd = nd++;
}
}
myFile.close();
delay (200);
if(nd>20)
{ss=0;
wifi=20;
goto stops;
}
//*******************************чтение символа погоды и запись его в массив**********************************************************
nd=0;
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
if (sd.exists("prognoz.txt"))
{name= "prognoz.txt";
}//установка раб директории
else
{name= "prognoz1.txt";
}
myFile.open(name, O_READ);
char token1[] = "var=\"???";
i = 0, j = 0;
byte pogread;
byte pog[6];
nd=0;
//while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token1[i] || token1[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token1[i] == '?') && (j < 3)) {
imageId[j] = symbol;
if (j==0)
pogread=10*(symbol-48);//перевод символа в число мес*10+ед мес
if (j==1)
pogread=pogread+(symbol-48);
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==3)
{
pog[nd]=pogread;
nd = nd++;
}
}
myFile.close();
delay (200);
//*********вывод иконок погоды на экран******************************************
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
byte q=0;
nd=0;
char* p[]={"01.raw","02.raw","03.raw","04.raw","09.raw","10.raw","11.raw","13.raw","50.raw","01n.raw","02n.raw"};
while( nd < 6)// вывод иконок погоды на экран
{
if (pog[nd]<5)
q=pog[nd]-1;
if (pog[nd]>5 && pog[nd]<13)
q=pog[nd]-5;
if (pog[nd]==13)
q=7;
if (pog[nd]==50)
q=8;
//myFiles.loadBitmap(135, 28+71*nd, 65, 63, p[q]);
//myGLCD.drawBitmap (135, m+(28+71*nd), 65, 1, pic1, 1);
//*************************************************************
myFile.open(p[q], O_READ);
int n=0;
int m=0;
for (i =0 ; i < 4225; i = i++)
{
n=n+1;
bait = myFile.read();
bait1 =myFile.read();
// w1= (bait - 48) << 4 | (bait1 - 48);
// w2= (bait2 - 48) << 4 | (bait3 - 48);
w= bait<<8|bait1;
pic1[n]=w;
//3199
if (n>64){
n=0;
// myGLCD.drawBitmap (0, 20*m, 320, 10, pic1, 2);
// myGLCD.drawBitmap (0, 2*m, 320, 1, pic1, 2);
//myGLCD.drawBitmap (0, 2*m, 400, 1, pic1, 2);
myGLCD.drawBitmap (135, m+(28+71*nd), 65, 1, pic1, 1);
m=m+1;
}
}
myFile.close();
delay (200);
//******************************************************************
nd = nd++;
}
nd=0;
// считывание и вывод температуры
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
if (sd.exists("prognoz.txt"))
{name= "prognoz.txt";
}//установка раб директории
else
{name= "prognoz1.txt";
}
myFile.open(name, O_READ);
nd=0;
i = 0, j = 0;
char token2[] = "max=\"?????";
char imageId1[4] = "000";
//char zn[2] = "+";
int tmaxim=0;
int tmaximd=0;
//while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token2[i] || token2[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token2[i] == '?') && (j < 5)) {
if(j==0)
{ tmaxim=tmaxim+100*(symbol-48);
}
if(j==1)
{ tmaxim=tmaxim+10*(symbol-48);
}
if(j==2)
{ tmaxim=tmaxim+(symbol-48);
}
if(j==4)
{ tmaximd=symbol-48;
if((tmaximd>9)||(tmaximd<1))tmaximd=0;
}
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==5)
{//282.62
myGLCD.setColor(251, 181, 168);
myGLCD.setFont( Ubuntubold);
if (tmaxim>=273)
{tmaxim=tmaxim-273;
myGLCD.print("+",240-24, 30+70*nd);
myGLCD.printNumI(tmaxim,240, 30+70*nd);
if(tmaxim>9)
{myGLCD.print(".",240+38, 30+70*nd);
myGLCD.printNumI(tmaximd,240+38+15, 30+70*nd);
}
else
{myGLCD.print(".",240+24, 30+70*nd);
myGLCD.printNumI(tmaximd,240+48, 30+70*nd);
}
}
else
{tmaxim=273-tmaxim;
myGLCD.print("-",240-24, 30+70*nd);
myGLCD.printNumI(tmaxim,240, 30+70*nd);
if(tmaxim>9)
{myGLCD.print(".",240+38, 30+70*nd);
myGLCD.printNumI(tmaximd,240+38+15, 30+70*nd);
}
else
{myGLCD.print(".",240+24, 30+70*nd);
myGLCD.printNumI(tmaximd,240+48, 30+70*nd);
}
}
nd = nd++;
tmaxim=0;
tmaximd=0;
}
}
myFile.close();
delay (200);
// считывание и вывод температуры
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
if (sd.exists("prognoz.txt"))
{name= "prognoz.txt";
}//установка раб директории
else
{name= "prognoz1.txt";
}
myFile.open(name, O_READ);
nd=0;
char token3[] = "min=\"?????";
int tminim=0;
int tminimd=0;
i = 0, j = 0;
// while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token3[i] || token3[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token3[i] == '?') && (j < 5)) {
if(j==0)
{ tminim=tminim+100*(symbol-48);
}
if(j==1)
{ tminim=tminim+10*(symbol-48);
}
if(j==2)
{ tminim=tminim+(symbol-48);
}
if(j==4)
{ tminimd=symbol-48;
if((tminimd>9)||(tminimd<1))tminimd=0;
}
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==5)
{
myGLCD.setColor(0, 181, 243);
myGLCD.setFont( Ubuntubold);
// myGLCD.print(zn,240-24+24, 60+70*nd);
// myGLCD.print(imageId1,240+24, 60+70*nd);
if (tminim>=273)
{tminim=tminim-273;
myGLCD.print("+",240-24+12, 60+70*nd);
myGLCD.printNumI(tminim,240+12, 60+70*nd);
if(tminim>9)
{myGLCD.print(".",240+38+12, 60+70*nd);
myGLCD.printNumI(tminimd,240+38+15+12, 60+70*nd);
}
else
{myGLCD.print(".",240+24+12, 60+70*nd);
myGLCD.printNumI(tminimd,240+48+12, 60+70*nd);
}
}
else
{tminim=273-tminim;
myGLCD.print("-",240-24+12, 60+70*nd);
myGLCD.printNumI(tminim,240+12, 60+70*nd);
if(tminim>9)
{myGLCD.print(".",240+38+12, 60+70*nd);
myGLCD.printNumI(tminimd,240+38+15+12, 60+70*nd);
}
else
{myGLCD.print(".",240+24+12, 60+70*nd);
myGLCD.printNumI(tminimd,240+48+12, 60+70*nd);
}
}
nd = nd++;
tminim=0;
tminimd=0;
}
}
myFile.close();
delay (200);
// считывание и вывод pressure
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
if (sd.exists("prognoz.txt"))
{name= "prognoz.txt";
}//установка раб директории
else
{name= "prognoz1.txt";
}
myFile.open(name, O_READ);
nd=0;
char token4[] = "Pa\" value=\"????";
long pres;//pressure
boolean dec=0;
i = 0, j = 0;
//while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token4[i] || token4[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token4[i] == '?') && (j < 4)) {
if(j==0)
{ if (symbol==57)//pres<1000pa 999
{ pres=100*(symbol-48);//перевод символа в число
dec=0;
}
else
{ pres=1000*(symbol-48);//перевод символа в число 1021
dec=1;//флаг давление больше 1000 па
}
}
if(j==1)
{ if (dec=0)//pres<1000pa 999
{pres=pres+10*(symbol-48);
}
}
if(j==2)
{ if (dec=1)//pres>1000pa 1021
{ pres=pres+10*(symbol-48);
}
else
{pres=pres+(symbol-48);//999
}
}
if(j==3)
{if (dec=1)//pres>1000pa 1021
{pres=pres+(symbol-48);
}
}
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==4)
{ pres=pres*100/134;
myGLCD.setColor(255, 242, 0);
myGLCD.setFont( Ubuntubold);
myGLCD.printNumI(pres,350, 30+70*nd);
myGLCD.print("mm",350+72, 30+70*nd);
if (nd==1){preszav=pres;}
pres=0;
nd = nd++;
}
}
nd=0;
myFile.close();
delay (200);
// считывание и вывод humidity
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
if (sd.exists("prognoz.txt"))
{name= "prognoz.txt";
}//установка раб директории
else
{name= "prognoz1.txt";
}
myFile.open(name, O_READ);
nd=0;
char token5[] = "ty value=\"??";
byte hum=0;//humidity
i = 0, j = 0;
// while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token5[i] || token5[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token5[i] == '?') && (j < 2)) {
if(j==0)
{ if (symbol==49)//hum=100%
{ hum=100;
}
else
{ hum=10*(symbol-48);//перевод символа в число
}
if (symbol==48)//hum=100%
hum=0;
}
if(j==1)
{ if ((hum>0)&&(hum<100))//
{pres=pres+10*(symbol-48);
hum=hum+(symbol-48);
}
}
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==2)
{
myGLCD.setColor(163,163,250);
myGLCD.setFont( Ubuntubold);
if ((hum>0)&&(hum<100))//
{myGLCD.printNumI(hum,350+24, 60+70*nd);
myGLCD.print("%",350+72, 60+70*nd);
}
if (hum==0)//
{
myGLCD.print(" - ",350+24, 60+70*nd);
}
if (hum==100)//
{
myGLCD.print("99%",350+24, 60+70*nd);//myGLCD.print(text, X,Y, DEG);drawCircle(100,120,50);
}
hum=0;
nd = nd++;
}
}
nd=0;
myFile.close();
delay (200);
// считывание и вывод напр ветра
sd.chdir("/");
delay (200);
sd.chdir("progn");
delay (200);
myFile.open(name, O_READ);
nd=0;
char token6[] = "deg=\"???";
int grad=0;//gradus
i = 0, j = 0;
//while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token6[i] || token6[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token6[i] == '?') && (j < 3)) {
imageId1[j] = symbol;
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==3)
{
//myGLCD.setColor(163,163,250);
myGLCD.setFont( Ubuntubold);
if((imageId1[2]>47)&&(imageId1[2]<58))
{grad=100*(imageId1[0]-48)+10*(imageId1[1]-48)+(imageId1[2]-48);
}
else
{ if((imageId1[1]>47)&&(imageId1[1]<58))
{grad=10*(imageId1[0]-48)+(imageId1[1]-48);
}
else
{grad=(imageId1[0]-48);
}
}
//myGLCD.print(text, X,Y, DEG);drawCircle(100,120,50);
myGLCD.setColor(255,255,255);
myGLCD.drawCircle (60+350+100,63+70*nd,20);
myGLCD.drawCircle (60+350+100,63+70*nd,18);
myGLCD.drawLine(60+350+100-20,63+70*nd,60+350+100+20,63+70*nd);
myGLCD.drawLine(60+350+100,63+70*nd-20,60+350+100,63+70*nd+20);
myGLCD.setFont( BigFont);
myGLCD.setColor(41,209,255);//N
myGLCD.print("N",60+350+100-8, 60+70*nd-20-10);
myGLCD.setColor(255,20,20);//S
myGLCD.print("S",60+350+100-8, 60+70*nd+24);
myGLCD.setColor(22,233,10);//W
myGLCD.print("W",60+350+100-20-16, 60+70*nd-10);
myGLCD.setColor(255,255,0);//E
myGLCD.print("E",60+350+100+20+1, 60+70*nd-10);
myGLCD.setFont( Ubuntubold);// определение направления ветра по углу
if ((grad>0) && (grad<22))
{myGLCD.setColor(41,209,255);//N
myGLCD.print("N",60+350+112+35, 60+70*nd-20-5);
if (nd==0){vet=1;}
if (nd==1){vetzav=1;}
}
if ((grad>21) && (grad<66))
{myGLCD.setColor(41,209,255);//N
myGLCD.print("N",60+350+112+35, 60+70*nd-20-5);
myGLCD.setColor(255,255,0);//E
myGLCD.print("E",60+350+112+35+24, 60+70*nd-20-5);
if (nd==0){vet=2;}
if (nd==1){vetzav=2;}
}
if ((grad>65) && (grad<112))
{myGLCD.setColor(255,255,0);//E
myGLCD.print("E",60+350+112+35, 60+70*nd-20-5);
if (nd==0){vet=3;}
if (nd==1){vetzav=3;}
}
if ((grad>111) && (grad<156))
{myGLCD.setColor(255,20,20);//S
myGLCD.print("S",60+350+112+35, 60+70*nd-20-5);
myGLCD.setColor(255,255,0);//E
myGLCD.print("E",60+350+112+35+24, 60+70*nd-20-5);
if (nd==0){vet=4;}
if (nd==1){vetzav=4;}
}
if ((grad>155) && (grad<202))
{myGLCD.setColor(255,20,20);//S
myGLCD.print("S",60+350+112+35, 60+70*nd-20-5);
if (nd==0){vet=5;}
if (nd==1){vetzav=5;}
}
if ((grad>201) && (grad<247))
{myGLCD.setColor(255,20,20);//S
myGLCD.print("S",60+350+112+35, 60+70*nd-20-5);
myGLCD.setColor(22,233,10);//W
myGLCD.print("W",60+350+112+35+24, 60+70*nd-20-5);
if (nd==0){vet=6;}
if (nd==1){vetzav=6;}
}
if ((grad>246) && (grad<292))
{myGLCD.setColor(22,233,10);//W
myGLCD.print("W",60+350+112+35, 60+70*nd-20-5);
if (nd==0){vet=7;}
if (nd==1){vetzav=7;}
}
if ((grad>291) && (grad<337))
{myGLCD.setColor(41,209,255);//N
myGLCD.print("N",60+350+112+35, 60+70*nd-20-5);
myGLCD.setColor(22,233,10);//W
myGLCD.print("W",60+350+112+35+24, 60+70*nd-20-5);
if (nd==0){vet=8;}
if (nd==1){vetzav=8;}
}
if ((grad>336) && (grad<361))
{myGLCD.setColor(22,233,10);//W
myGLCD.print("N",60+350+112+35, 60+70*nd-20-5);
if (nd==0){vet=1;}
if (nd==1){vetzav=1;}
}
if ((grad>0) && (grad<45))
myGLCD.setColor(41,209,255);//N
if ((grad>314) && (grad<370))
myGLCD.setColor(41,209,255);//N
if ((grad>44) && (grad<135))//E
myGLCD.setColor(255,255,0);//E
if ((grad>134) && (grad<225))//S
myGLCD.setColor(255,20,20);//S
if ((grad>224) && (grad<315))//W
myGLCD.setColor(22,233,10);//W
//myGLCD.print("'", 60+350+72,63+70*nd, grad);
// myGLCD.printNumI(grad,60+350+100+30-8, 60+70*nd+18);//вывод угла ветра градусы
if (grad<90)
{grad=360+grad-90;
}
else
{grad=grad-90;
}
float xg=20*cos(grad*0.0175);
float yg=20*sin(grad*0.0175);
myGLCD.drawLine(60+350+100,63+70*nd,60+350+100+xg,63+70*nd+yg);
myGLCD.drawLine(60+350+100+1,63+1+70*nd,60+350+100+1+xg,63+1+70*nd+yg);
myGLCD.drawLine(60+350+100-1,63-1+70*nd,60-1+350+100+xg,63-1+70*nd+yg);
nd = nd++;
}
}
nd=0;
myFile.close();
delay (100);
// считывание и вывод speed veter
sd.chdir("/");
delay (100);
sd.chdir("progn");
delay (100);
myFile.open(name, O_READ);
nd=0;
char token7[] = "mps=\"????";
char imageId2[5] = "0000";
i = 0, j = 0;
// while( nd < 6)
while((myFile.peek()!=EOF)&(nd < 6))
{
symbol = myFile.read();
// Сравниваем его с маской
if (symbol == token7[i] || token7[i] == '?') {
// Если сравнение успешно, то проверяем, не дошли ли мы до
// цифр в названии файла
if ((token7[i] == '?') && (j < 4))
{
imageId2[j] = symbol;
++j;
}
++i;
} else {
// Если сравнение не удалось, то сбрасываем счетчик
i = 0;
j = 0;
}
if (j==4)
{
myGLCD.setColor(22,233,10);
myGLCD.setFont( BigFont);
//myGLCD.setFont( Ubuntubold);
if((imageId2[0]>54)||(imageId2[1]>47))
{myGLCD.setColor(250,250,250);
myGLCD.setFont( Ubuntubold);
myGLCD.print("#",60+350+100+30-8+73, 60+70*nd-20-8);
myGLCD.setColor(200,190,250);
myGLCD.setFont( BigFont);
}
myGLCD.print(imageId2,60+350+100+30-8, 60+70*nd+14);
myGLCD.print("ms",60+350+100+30-8+64, 60+70*nd+14);
if (nd==0)
{
if ((imageId2[1]>47)&&(imageId2[1]<58))
{vetc=(imageId2[0]-48)*10+(imageId2[1]-48);//01.2 ms
if ((imageId2[3]>47)&&(imageId2[3]<58)){vetd=imageId2[3]-48;}
}
else
{vetc=(imageId2[0]-48);//1.12 ms
if ((imageId2[2]>47)&&(imageId2[2]<58)){vetd=imageId2[2]-48;}
}
}
if (nd==1)
{
if ((imageId2[1]>47)&&(imageId2[1]<58))
{vetczav=(imageId2[0]-48)*10+(imageId2[1]-48);//11.2 ms
if ((imageId2[3]>47)&&(imageId2[3]<58)){vetdzav=imageId2[3]-48;}
}
else
{vetczav=(imageId2[0]-48);//1.12 ms
if ((imageId2[2]>47)&&(imageId2[2]<58)){vetdzav=imageId2[2]-48;}
}
}
nd = nd++;
}
}
myFile.close();
delay (200);
nd=0;
sd.chdir("/");
//**************************************************************
if (rawp==1)
{delay (1000);
rawp=0;
return;
}
while(1)
{
sec=t.sec;
if ((sec==0)||(sec==20)||(sec==40))
{
delay(800);
clc();
}
if ((sec==14) || (sec==42) )
{
//******DHT read********
info();
}
if (myTouch.dataAvailable())
{
myTouch.read();
int x=myTouch.getX();
int y=myTouch.getY();
myGLCD.setColor(VGA_BLUE);
myGLCD.setBackColor(255,255,255);
myGLCD.setFont( Ubuntubold);
// myGLCD.print("x= " , 650, 32);
// myGLCD.printNumI(x , 700, 32);
// myGLCD.setFont( Ubuntubold);
// myGLCD.print("y= " ,650 , 72);
// myGLCD.printNumI(y , 700, 72);
if ((x>=640) && (x<=799)) // Upper row
{
if ((y>=10) && (y<=150)) //(10, 370, 90, 450); //Install
{
kalendarset();
// prognoz();
readprognoz();
}
if ((y>=370) && (y<=450)) //(10, 370, 90, 450); //Clok
{waitForIt1(639, 370, 799, 450);
menu();
}
}
}//touch
}//while
delay(3000);
}