Pero tengo problemas con un programa mayor en su #include lineas no puedo meter todas las fuciones de la aplicacion
me queda a si
void curvas(){
////////CURVAS....
toke[0]--;//de yy1
if(toke[0]>1){
//if(toke[0]>10){ yy1[fx]+=curva[0]; }///si toke es 10 o - se hace recta final
if(na[0]<2){ yy1[fx]+=curva[0]; } else { na[0]--; }
if(yy1[fx]<1){ yy1[fx]=1; }
else { if(yy1[fx]>fintp[0]){ yy1[fx]=fintp[0]; } } }
else { opera(0); }
toke[1]--;//de yy2
if(toke[1]>1){
///if(toke[1]>10){ yy2[fx]+=curva[1]; }
if(na[1]<2){ yy2[fx]+=curva[1]; } else { na[1]--; }
if(yy2[fx]<initp[1]){ yy2[fx]=initp[1]; }
else { if(yy2[fx]>fintp[1]){ yy2[fx]=fintp[1]; } } }
else { opera(1); }
///////....CURVAS
}
void refresca(){
///byte al=veloz/4;// altura de linea
///if(al<1){ al=1; }
for(co=ix;fx>co;co+=6){
///if(yy1[co]!=yy1[co+1]){
//// tft.fillRect(yy1[co]-3,co,3,1,BLACK); tft.fillRect(yy1[co],co,longit2,1,YELLOW); tft.fillRect(yy1[co]+longit2,co,3,1,BLACK);
///} else {
tft.fillRect(yy1[co]-3,co,3,1,BLACK); tft.fillRect(yy1[co],co,longit,1,YELLOW); tft.fillRect(yy1[co]+longit,co,3,1,BLACK);
tft.fillRect(yy2[co]-3,co,3,1,BLACK); tft.fillRect(yy2[co],co,longit,1,YELLOW); tft.fillRect(yy2[co]+longit,co,3,1,BLACK);
}///for(co)
if(infor>0){
if(rfrs){//referencia mostrar fallo
tft.fillRect(10,4,150,16,BLACK);
//// tft.fillRect(8,4,165,16,BLACK);
color0(fallo,sg); tft.setCursor(10, 5);
tft.setTextSize(2);
tft.println("fallo="+String(fallo));////+" "+String(dv)+"-"+String(dr)+"("+String(di)+")");
if(infor>1){ men2();
}//(infor>1)
rfrs=0;////ya se hizo
} }///if(infor>0)
//if(rfs1){ dificulta(); rfs1=0; }//referencia ekilibrar
}
void circulos(){
if(trampa>0){
v8=longit/2;
v16=yy1[140]+v8;
vv16=yy2[140]+v8;
switch (trampa){
case 1: cir1=v16; cir2=analogRead(ana13); cir2/=5; cir2+=245; break;
case 2: cir1=analogRead(ana12); cir1/=5; cir1+=10; cir2=vv16; break;
case 3: cir1=v16; cir2=vv16; break;
}
} else {
cir1=analogRead(ana12); //delay(20);
cir1/=5;
cir1+=10;
cir2=analogRead(ana13);
cir2/=5;
cir2+=245;
}
dibuja();
/////.....circulo
//delay(1000);
}
void scrol(){
///tft.fillRect(ix,ix,220,220,BLUE);
//tft.fillRect(ix,ix,220,220,BLACK);
for(int c1=ix;fx>c1;c1++){
yy1[c1]=yy1[c1+1];
yy2[c1]=yy2[c1+1];
}
}
pero da error de declaration does not declare anything
-fpermissive (declaración no declara nada -permisivo)
a cualquiera de estas que son de la misma aplicacion no se si es porque utilizan sus variables locales o que agradeceria cualquier sugerencia, estas no las acmite dentro de "lineas.h"
void T1(){
sg++; ts++;
if(sg>59){ if(eki){ dificulta(); }//sg>59
grava[nu]=fallo;
sped[nu+1]=veloz;
nu++;
sg=0; fallo=0;
if(nu>11){ sal=1; Timer1.stop(); }
}
rfrs=1;
}
void opera(boolean line){
//int u0,u1,u2,u3;//umbrales <--- . ---> todos a partir de inicio yy_[_]
///u0=50; u1=190-longit;
///u2=280; u3=430-longit;
//tft.fillRect(u0,20,1,300,RED); tft.fillRect(u1,20,1,300,RED);
///tft.fillRect(u2,20,1,300,RED); tft.fillRect(u3,20,1,300,RED);
if(!line){//referencia a linea 1 yy1
if(yy1[fx]<u0){ curva[line]=random(1,3); }//--->
else { if(yy1[fx]>u1){ curva[line]=random(-3,-1); }////<----
else { curva[line]=random(-3,3); } }///<---.--->
} else { ///referencia a linea 2 yy2
if(yy2[fx]<u2){ curva[line]=random(1,3); }//--->
else { if(yy2[fx]>u3){ curva[line]=random(-3,-1); }////<----
else { curva[line]=random(-3,3); } }///<---.--->
}
if(curva[line]>0){ if(izk[line]) { izk[line]=0; na[line]=10; } }// if actual---> && anterior <----
if(curva[line]<0){ if(!izk[line]) { izk[line]=1; na[line]=10; } }// if actual<---- && anterior ---->
if(curva[line]>1 || curva[line]<-1){ // || curva[line]==0){///si la curva es muy prolongada || es una recta
toke[line]=random(30,50);////menos tiempo
} else { toke[line]=random(40,90); }
//tft.setCursor(0, 225);
// tft.setTextColor(WHITE); tft.setTextSize(2);
// tft.fillRect(70,225,100,20,CYAN); tft.println("curva="+String(curva[0])+" y="+String(yy1[fx]));
}
void dibuja(){
///cir1=analogRead(ana12); ////circulo.....
if(mc1!=cir1){ tft.fillCircle(mc1,140,radio, BLACK); }//borra circulo anterior a BLACK si cambio de posicion
mc1=cir1;
///cir2=analogRead(ana13);
if(mc2!=cir2){ tft.fillCircle(mc2,140,radio, BLACK); }//borra circulo anterior
mc2=cir2;
///tft.fillCircle(cir1,110,radio, MAGENTA);
////tft.fillCircle(cir2,110,radio, MAGENTA);
alarma=0;
//DIBUJA CIRCULOS ROJO fuera de limite ROSA dentro de limite
if(cir1-radio<yy1[140] || cir1+radio>yy1[140]+longit){ tft.fillCircle(cir1,140,radio, RED); if(!paus){ alarma=1; fallo+=0.01; ft+=0.01; }//FUERA
} else { tft.fillCircle(cir1,140,radio, MAGENTA); }//DENTRO
if(cir2-radio<yy2[140] || cir2+radio>yy2[140]+longit){ tft.fillCircle(cir2,140,radio, RED); if(!paus){ alarma=1; fallo+=0.01; ft+=0.01; } //FUERA...
} else { tft.fillCircle(cir2,140,radio, MAGENTA); }//DENTRO
if(!alarma){ digitalWrite(bufer, LOW); }
else { digitalWrite(bufer, HIGH);
if(infor>0){ tft.fillRect(10,4,150,16,BLACK); tft.setTextSize(2); color0(fallo,sg); tft.setCursor(10, 5); tft.println("fallo="+String(fallo)); } }//
}
void fin0(){
digitalWrite(bufer, LOW);
sal=0; tft.fillScreen(BLACK);
if(nu>0){
int xx[6]={20,130,240,350};
byte yy[4]={90,150,210};
tft.setTextSize(3);
tft.setCursor(25, 20); tft.setTextColor(BLUE); tft.print("FALLOS X MINUTO");// tft.setCursor(190, 10); tft.println("total="+String(total));
tft.setTextColor(WHITE ); tft.setCursor(340, 20); tft.println(String(nu)+"''"+String(sg)+"'");
lx=0; ly=0;
for(co=0;nu>co;co++){
tft.setCursor(xx[lx],yy[ly]);
color0(grava[co],60); //60
tft.println(String(grava[co]));
if(gs){ tft.setTextColor(WHITE ); tft.setCursor(xx[lx],yy[ly]-11); tft.setTextSize(1); tft.println("speed "+String(sped[co]));tft.setTextSize(3); }
lx++; if(lx>3){ lx=0; ly++; }
}//for(co)
if(sg>0){ tft.setTextSize(2); tft.setCursor(xx[lx],yy[ly]); color0(fallo,sg); tft.println("+ "+String(fallo));
if(gs){ tft.setTextColor(WHITE ); tft.setCursor(xx[lx],yy[ly]-11); tft.setTextSize(1); tft.println("speed "+String(sped[co]));tft.setTextSize(3); }
}//if(sg>0)
tft.setTextSize(3);
tft.setTextColor(BLUE); tft.setCursor(80, 280); tft.print("TOTAL"); /// tft.setCursor(250, 200); tft.println("nu="+String(nu));
color0(ft,sg+(nu*60)); tft.setCursor(190, 280); tft.println(String(ft));
tft.setTextColor(BLUE); tft.setCursor(285, 280); tft.print("fallos");
} else {///de if(nu>0){
tft.setTextSize(4);
tft.setTextColor(WHITE ); tft.setCursor(120, 80); tft.println(String(nu)+"''"+String(sg)+"'");
color0(fallo,sg); tft.setCursor(80, 160); tft.println(String(fallo));
tft.setTextColor(BLUE); tft.setCursor(210, 160); tft.print("fallos");
}
ini=0;
inicio();
antirrebote(1);
tft.fillScreen(BLACK);
}
void dificulta(){
//digitalWrite(bufer, HIGH);
dv=0.006*sg;
dr=0.02*sg;
di=0.03*sg;
///FALLANDO
if(fallo>dr){ veloz--; if(fallo>di){ veloz--; //2 veces mas lento en ROJO
if(fallo>di*2){ veloz--; if(fallo>di*4){ veloz--; } } }//2 veces mas lento si sobrepasa mucho ROJO
if(veloz<2){ veloz=1; } //limite veloz=1
} else { veloz++; if(fallo<dv){ veloz++; if(fallo<dv/2){ veloz++; } } if(veloz>20){ veloz=20; } }///APROBANDO
gs=1;
retar=retardo(veloz);
men();
//digitalWrite(bufer, LOW);
}
void color0(float f,int t){//(fallos,tiempo)
///tft.setTextSize(2);
dv=0.006*t;
dr=0.02*t;
di=0.03*t;
if(f>di){ tft.setTextColor(RED); }
else { if(f>dr){ tft.setTextColor(YELLOW); }
else { if(f>dv){ tft.setTextColor(CYAN); } else { tft.setTextColor(GREEN); }
} }
}
int retardo(byte es){
switch (es){
case 1: return 140;
case 2: return 120;
case 3: return 100;
case 4: return 80;
case 5: return 70;
case 6: return 60;
case 7: return 50;
case 8: return 40;
case 9: return 32;
case 10: return 28;
case 11: return 24;
case 12: return 20;
case 13: return 16;
case 14: return 13;
case 15: return 10;
case 16: return 7;
case 17: return 5;
case 18: return 3;
case 19: return 1;
case 20: return 0;
}///switch (veloz)
}