Тема: Аудиопроцессор TDA7419 + LCD TFT 2,4 (SPFD5408)
Аудиопроцессор TDA7419 обладает очень хорошими параметрами звучания, а так же большим функционалом, позволяющий оптимально настроить звучание Вашей аудио системы.
Основная статья - http://rcl-radio.ru/?p=57658
https://github.com/liman324/TDA7419.git
http://rcl-radio.ru/wp-content/uploads/ … _GFX-1.zip
http://rcl-radio.ru/wp-content/uploads/ … 5408-1.zip
#include <Wire.h>
#include <SPI.h>
#include <TDA7419.h>
#include <EEPROM.h>
TDA7419 tda;
#include <Adafruit_GFX.h>
#include <TftSpfd5408.h>
#include <SPI.h>>
TftSpfd5408 tft(A3,A2,A1,A0,A4);/// LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET // A3,A2,A1,A0,rst
// D0 pin 8, D1 pin 9, D2 pin 2, D3 pin 3, D4 pin 4, D5 pin 5, D6 pin 6,D7 pin 7
int menu,pluse,minus,mute=1;
int i,i2,vol=50,set,treb,mid,bass,in,gain,gain1,gain2,gain3,lf,lt,rf,rt,sab,att_loun,s_loun,treb_c,middle_c,bass_c,sub_f,middle_q,bass_q;
byte eeprom;
int w=1,w1=1,w2=1,w3=1,w4=1,w5=1,w6=1,w7=1,w8=1,w9=1,w10=1,w11=1,w12=1,w13=1,w14=1,w15=1,w16=1,w17=1;
unsigned long time,times,t;
void setup(){tft.reset();tft.begin(0x9341);Serial.begin(9600);
tft.setRotation(1);tft.fillScreen(0x0000);tft.setTextColor(0xFFFF);;
pinMode(13,INPUT);/// set
pinMode(12,INPUT);/// menu
pinMode(11,INPUT);/// +
pinMode(10,INPUT);/// -
vol = EEPROM.read(0);treb = EEPROM.read(1)-15;mid = EEPROM.read(2)-15;bass = EEPROM.read(3)-15;in = EEPROM.read(4);
gain1 = EEPROM.read(5);gain2 = EEPROM.read(6);gain = EEPROM.read(7);
lf = EEPROM.read(8);lt = EEPROM.read(9);rf = EEPROM.read(10);rt = EEPROM.read(11);sab = EEPROM.read(12);
att_loun = EEPROM.read(13);s_loun = EEPROM.read(14);treb_c = EEPROM.read(15);middle_c = EEPROM.read(16);bass_c = EEPROM.read(17);
sub_f = EEPROM.read(18);middle_q = EEPROM.read(19);bass_q = EEPROM.read(20);
audio();
}
void loop(){
times=millis();
tft.setTextColor(0xFFFF);;tft.setTextSize(1);
pluse=digitalRead(11);minus=digitalRead(10);
if(menu==0){}else{tft.setTextColor(0xcdcd);}tft.setCursor(10,5);tft.print("VOLUME");
if(menu==1){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.setCursor(10,20);tft.print("TREBLE");
if(menu==2){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.setCursor(10,35);tft.print("MIDDLE");
if(menu==3){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.setCursor(10,50);tft.print("BASS");
tft.drawFastHLine(5,65,310, 0xcdcd);tft.drawFastHLine(5,90,310, 0xcdcd);tft.drawFastHLine(5,115,310, 0xcdcd);tft.drawFastHLine(5,140,310, 0xcdcd);
if(digitalRead(12)==HIGH){menu++; sbros();eeprom=1;time=millis();if(menu>3){menu=0;set=0;}}
if(digitalRead(13)==HIGH){set++;sbros();eeprom=1;time=millis(); menu=100;if(set>15){set=0;menu=0;}}
if(pluse==HIGH&&minus==HIGH){mute++;w=1;if(mute>1){mute=0;}}
if(pluse==HIGH&&menu==0){vol++;eeprom=1;time=millis();if(vol>80){vol=80;}w=1;}
if(minus==HIGH&&menu==0){vol--;eeprom=1;time=millis();if(vol<0){vol=0;}w=1;}
if(pluse==HIGH&&menu==1){treb++;if(treb>15){treb=15;}w1=1;}
if(minus==HIGH&&menu==1){treb--;if(treb<-15){treb=-15;}w1=1;}
if(pluse==HIGH&&menu==2){mid++;if(mid>15){mid=15;}w2=1;}
if(minus==HIGH&&menu==2){mid--;if(mid<-15){mid=-15;}w2=1;}
if(pluse==HIGH&&menu==3){bass++;if(bass>15){bass=15;}w3=1;}
if(minus==HIGH&&menu==3){bass--;if(bass<-15){bass=-15;}w3=1;}
if(w==1){audio();
for(i=0,i2=0;i<=80;i++,i2++){if(i2<vol){}else{i2=vol;}
if(mute==1){tft.drawFastHLine(i2*2+70,7,1, 0x07ff);}else{tft.drawFastHLine(i2*2+70,7,1, 0x0f800);}tft.drawFastHLine(i*2+72,7,1, 0xcdcd);
if(mute==1){tft.drawFastHLine(i2*2+70,9,1, 0x07ff);}else{tft.drawFastHLine(i2*2+70,9,1, 0x0f800);}tft.drawFastHLine(i*2+72,9,1, 0xcdcd);
if(mute==1){tft.drawFastHLine(i2*2+70,11,1, 0x07ff);}else{tft.drawFastHLine(i2*2+70,11,1, 0x0f800);}tft.drawFastHLine(i*2+72,11,1, 0xcdcd);
}w=0;tft.setTextColor(0xF600);tft.fillRect(270, 0, 40, 15, 0x0000);tft.setCursor(270,5);tft.print(-80+vol);tft.setCursor(290,5);tft.print(" dB");}
if(w1==1){audio();
for(i=0,i2=0;i<=80;i++,i2++){i2=treb*2+40;
tft.drawFastHLine(i*2+70,21,1, 0xcdcd);tft.drawFastHLine(i2*2+70,21,1, 0x07ff);tft.drawFastHLine(i*2+72,21,1, 0xcdcd);
tft.drawFastHLine(i*2+70,23,1, 0xcdcd);tft.drawFastHLine(i2*2+70,23,1, 0x07ff);tft.drawFastHLine(i*2+72,23,1, 0xcdcd);
tft.drawFastHLine(i*2+70,25,1, 0xcdcd);tft.drawFastHLine(i2*2+70,25,1, 0x07ff);tft.drawFastHLine(i*2+72,25,1, 0xcdcd);
}w1=0;tft.setTextColor(0xF600);tft.fillRect(270, 15, 40, 15, 0x0000);tft.setCursor(270,20);tft.print(treb);tft.setCursor(290,20);tft.print(" dB");w1=0;}
if(w2==1){audio();
for(i=0,i2=0;i<=80;i++,i2++){i2=mid*2+40;
tft.drawFastHLine(i*2+70,36,1, 0xcdcd);tft.drawFastHLine(i2*2+70,36,1, 0x07ff);tft.drawFastHLine(i*2+72,36,1, 0xcdcd);
tft.drawFastHLine(i*2+70,38,1, 0xcdcd);tft.drawFastHLine(i2*2+70,38,1, 0x07ff);tft.drawFastHLine(i*2+72,38,1, 0xcdcd);
tft.drawFastHLine(i*2+70,40,1, 0xcdcd);tft.drawFastHLine(i2*2+70,40,1, 0x07ff);tft.drawFastHLine(i*2+72,40,1, 0xcdcd);
}w2=0;tft.setTextColor(0xF600);tft.fillRect(270, 30, 40, 15, 0x0000);tft.setCursor(270,35);tft.print(mid);tft.setCursor(290,35);tft.print(" dB");w2=0;}
if(w3==1){audio();
for(i=0,i2=0;i<=80;i++,i2++){i2=bass*2+40;
tft.drawFastHLine(i*2+70,51,1, 0xcdcd);tft.drawFastHLine(i2*2+70,51,1, 0x07ff);tft.drawFastHLine(i*2+72,51,1, 0xcdcd);
tft.drawFastHLine(i*2+70,53,1, 0xcdcd);tft.drawFastHLine(i2*2+70,53,1, 0x07ff);tft.drawFastHLine(i*2+72,53,1, 0xcdcd);
tft.drawFastHLine(i*2+70,55,1, 0xcdcd);tft.drawFastHLine(i2*2+70,55,1, 0x07ff);tft.drawFastHLine(i*2+72,55,1, 0xcdcd);
}w3=0;tft.setTextColor(0xF600);tft.fillRect(270, 45, 40, 15, 0x0000);tft.setCursor(270,50);tft.print(bass);tft.setCursor(290,50);tft.print(" dB");w3=0;}
///////////////////////////////////////////////////////////input + gain//////////////////////////////////////////////////////////////////////////////////////////
if(pluse==HIGH&&set==1){in++;if(in>3){in=3;}audio();w4=1;}
if(minus==HIGH&&set==1){in--;if(in<1){in=1;}audio();w4=1;}
tft.setCursor(10,75);if(set==1){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("INPUT: ");
tft.setCursor(60,75);if(in==1&&set==1){tft.setTextColor(0xFFFF);}else if(in==1&&set!=1){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("IN 1");
tft.setCursor(90,75);if(in==2&&set==1){tft.setTextColor(0xFFFF);}else if(in==2&&set!=1){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("IN 2");
tft.setCursor(120,75);if(in==3&&set==1){tft.setTextColor(0xFFFF);}else if(in==3&&set!=1){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("IN 3");
tft.setCursor(150,75);
if(set==2){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}
if(in==1){gain=gain1;tft.print(" GAIN IN 1");}
if(in==2){gain=gain2;tft.print(" GAIN IN 2");}
if(in==3){gain=gain3;tft.print(" GAIN IN 3");}
if(pluse==HIGH&&set==2){gain++;if(gain>15){gain=15;}audio();w4=1;}
if(minus==HIGH&&set==2){gain--;if(gain<0){gain=0;}audio();w4=1;}
if(in==1){gain1=gain;}if(in==2){gain2=gain;}if(in==3){gain3=gain;}
if(w4==1){audio();
for(i=0,i2=0;i<=15;i++,i2++){if(i2<gain){}else{i2=gain;}
tft.drawFastHLine(i2*2+240,76,1, 0x07ff);tft.drawFastHLine(i*2+242,76,1, 0xcdcd);
tft.drawFastHLine(i2*2+240,78,1, 0x07ff);tft.drawFastHLine(i*2+242,78,1, 0xcdcd);
tft.drawFastHLine(i2*2+240,80,1, 0x07ff);tft.drawFastHLine(i*2+242,80,1, 0xcdcd);
}w4=0;tft.fillRect(195, 75, 40, 10, 0x0000);}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
tft.setCursor(10,100);if(set==3){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("LF ");
tft.setCursor(70,100);if(set==4){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("RF ");
tft.setCursor(130,100);if(set==5){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("LT ");
tft.setCursor(190,100);if(set==6){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("RT ");
tft.setCursor(250,100);if(set==7){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("SUB");
if(pluse==HIGH&&set==3){lf++;if(lf>30){lf=30;}audio();w5=1;}
if(minus==HIGH&&set==3){lf--;if(lf<0){lf=0;}audio();w5=1;}
if(w5==1){audio();
for(i=0,i2=0;i<=30;i++,i2++){if(i2<lf){}else{i2=lf;}
tft.drawFastHLine(i2+30,101,1, 0xf800);tft.drawFastHLine(i+31,101,1, 0xcdcd);
tft.drawFastHLine(i2+30,103,1, 0xf800);tft.drawFastHLine(i+31,103,1, 0xcdcd);
tft.drawFastHLine(i2+30,105,1, 0xf800);tft.drawFastHLine(i+31,105,1, 0xcdcd);
}w5=0;}
if(pluse==HIGH&&set==4){rf++;if(rf>30){rf=30;}audio();w6=1;}
if(minus==HIGH&&set==4){rf--;if(rf<0){rf=0;}audio();w6=1;}
if(w6==1){audio();
for(i=0,i2=0;i<=30;i++,i2++){if(i2<rf){}else{i2=rf;}
tft.drawFastHLine(i2+90,101,1, 0xf800);tft.drawFastHLine(i+91,101,1, 0xcdcd);
tft.drawFastHLine(i2+90,103,1, 0xf800);tft.drawFastHLine(i+91,103,1, 0xcdcd);
tft.drawFastHLine(i2+90,105,1, 0xf800);tft.drawFastHLine(i+91,105,1, 0xcdcd);
}w6=0;}
if(pluse==HIGH&&set==5){lt++;if(lt>30){lt=30;}audio();w7=1;}
if(minus==HIGH&&set==5){lt--;if(lt<0){lt=0;}audio();w7=1;}
if(w7==1){audio();
for(i=0,i2=0;i<=30;i++,i2++){if(i2<lt){}else{i2=lt;}
tft.drawFastHLine(i2+150,101,1, 0xf800);tft.drawFastHLine(i+151,101,1, 0xcdcd);
tft.drawFastHLine(i2+150,103,1, 0xf800);tft.drawFastHLine(i+151,103,1, 0xcdcd);
tft.drawFastHLine(i2+150,105,1, 0xf800);tft.drawFastHLine(i+151,105,1, 0xcdcd);
}w7=0;}
if(pluse==HIGH&&set==6){rt++;if(rt>30){rt=30;}audio();w8=1;}
if(minus==HIGH&&set==6){rt--;if(rt<0){rt=0;}audio();w8=1;}
if(w8==1){audio();
for(i=0,i2=0;i<=30;i++,i2++){if(i2<rt){}else{i2=rt;}
tft.drawFastHLine(i2+210,101,1, 0xf800);tft.drawFastHLine(i+211,101,1, 0xcdcd);
tft.drawFastHLine(i2+210,103,1, 0xf800);tft.drawFastHLine(i+211,103,1, 0xcdcd);
tft.drawFastHLine(i2+210,105,1, 0xf800);tft.drawFastHLine(i+211,105,1, 0xcdcd);
}w8=0;}
if(pluse==HIGH&&set==7){sab++;if(sab>30){sab=30;}audio();w9=1;}
if(minus==HIGH&&set==7){sab--;if(sab<0){sab=0;}audio();w9=1;}
if(w9==1){audio();
for(i=0,i2=0;i<=30;i++,i2++){if(i2<sab){}else{i2=sab;}
tft.drawFastHLine(i2+275,101,1, 0xf800);tft.drawFastHLine(i+276,101,1, 0xcdcd);
tft.drawFastHLine(i2+275,103,1, 0xf800);tft.drawFastHLine(i+276,103,1, 0xcdcd);
tft.drawFastHLine(i2+275,105,1, 0xf800);tft.drawFastHLine(i+276,105,1, 0xcdcd);
}w9=0;}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
tft.setCursor(10,125);if(set==8){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("LOUDNESS: ");
if(pluse==HIGH&&set==8){att_loun++;if(att_loun>15){att_loun=15;}audio();w10=1;}
if(minus==HIGH&&set==8){att_loun--;if(att_loun<0){att_loun=0;}audio();w10=1;}
if(w10==1){
for(i=0,i2=0;i<=30;i++,i2++){if(i2<att_loun){}else{i2=att_loun;}
tft.drawFastHLine(i2+80,126,1, 0xf800);tft.drawFastHLine(i+82,126,1, 0xcdcd);
tft.drawFastHLine(i2+80,128,1, 0xf800);tft.drawFastHLine(i+82,128,1, 0xcdcd);
tft.drawFastHLine(i2+80,130,1, 0xf800);tft.drawFastHLine(i+82,130,1, 0xcdcd);
}w10=0;}
if(pluse==HIGH&&set==9){s_loun++;if(s_loun>3){s_loun=3;}audio();w11=1;}
if(minus==HIGH&&set==9){s_loun--;if(s_loun<0){s_loun=0;}audio();w11=1;}
if(w11==1){audio();
tft.setCursor(130,125);if(s_loun==0&&set==9){tft.setTextColor(0xFFFF);}else if(s_loun==0&&set!=9){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("FLAT");
tft.setCursor(175,125);if(s_loun==1&&set==9){tft.setTextColor(0xFFFF);}else if(s_loun==1&&set!=9){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("400Hz");
tft.setCursor(225,125);if(s_loun==2&&set==9){tft.setTextColor(0xFFFF);}else if(s_loun==2&&set!=9){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("800Hz");
tft.setCursor(275,125);if(s_loun==3&&set==9){tft.setTextColor(0xFFFF);}else if(s_loun==3&&set!=9){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("2400Hz");w11=0;}
/////////////////////////////////////////////////////////////////////////////////////////////////////
tft.setCursor(10,150);if(set==10){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("TREBLE CENTER: ");
if(pluse==HIGH&&set==10){treb_c++;if(treb_c>3){treb_c=3;}audio();w12=1;}
if(minus==HIGH&&set==10){treb_c--;if(treb_c<0){treb_c=0;}audio();w12=1;}
if(w12==1){audio();
tft.setCursor(110,150);if(treb_c==0&&set==10){tft.setTextColor(0xFFFF);}else if(treb_c==0&&set!=10){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("10KHz");
tft.setCursor(160,150);if(treb_c==1&&set==10){tft.setTextColor(0xFFFF);}else if(treb_c==1&&set!=10){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("12.5kHz");
tft.setCursor(220,150);if(treb_c==2&&set==10){tft.setTextColor(0xFFFF);}else if(treb_c==2&&set!=10){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("15kHz");
tft.setCursor(270,150);if(treb_c==3&&set==10){tft.setTextColor(0xFFFF);}else if(treb_c==3&&set!=10){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("17.5kHz");w12=0;}
//////////////////////////////////////////////////////////////////////////////////////////////
tft.setCursor(10,165);if(set==11){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("MIDDLE CENTER: ");
if(pluse==HIGH&&set==11){middle_c++;if(middle_c>3){middle_c=3;}audio();w13=1;}
if(minus==HIGH&&set==11){middle_c--;if(middle_c<0){middle_c=0;}audio();w13=1;}
if(w13==1){audio();
tft.setCursor(110,165);if(middle_c==0&&set==11){tft.setTextColor(0xFFFF);}else if(middle_c==0&&set!=11){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("0.5KHz");
tft.setCursor(160,165);if(middle_c==1&&set==11){tft.setTextColor(0xFFFF);}else if(middle_c==1&&set!=11){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1kHz");
tft.setCursor(220,165);if(middle_c==2&&set==11){tft.setTextColor(0xFFFF);}else if(middle_c==2&&set!=11){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1.5kHz");
tft.setCursor(270,165);if(middle_c==3&&set==11){tft.setTextColor(0xFFFF);}else if(middle_c==3&&set!=11){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("2.5kHz");w13=0;}
//////////////////////////////////////////////////////////////////////////////////////////////
tft.setCursor(10,180);if(set==12){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("BASS CENTER: ");
if(pluse==HIGH&&set==12){bass_c++;if(bass_c>3){bass_c=3;}audio();w14=1;}
if(minus==HIGH&&set==12){bass_c--;if(bass_c<0){bass_c=0;}audio();w14=1;}
if(w14==1){audio();
tft.setCursor(110,180);if(bass_c==0&&set==12){tft.setTextColor(0xFFFF);}else if(bass_c==0&&set!=12){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("60Hz");
tft.setCursor(160,180);if(bass_c==1&&set==12){tft.setTextColor(0xFFFF);}else if(bass_c==1&&set!=12){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("80Hz");
tft.setCursor(220,180);if(bass_c==2&&set==12){tft.setTextColor(0xFFFF);}else if(bass_c==2&&set!=12){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("100Hz");
tft.setCursor(270,180);if(bass_c==3&&set==12){tft.setTextColor(0xFFFF);}else if(bass_c==3&&set!=12){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("200Hz");w14=0;}
//////////////////////////////////////////////////////////////////////////////////////////////
tft.setCursor(10,195);if(set==13){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("SUBWOOFER FREQ:");
if(pluse==HIGH&&set==13){sub_f++;if(sub_f>3){sub_f=3;}audio();w15=1;}
if(minus==HIGH&&set==13){sub_f--;if(sub_f<0){sub_f=0;}audio();w15=1;}
if(w15==1){audio();
tft.setCursor(110,195);if(sub_f==0&&set==13){tft.setTextColor(0xFFFF);}else if(sub_f==0&&set!=13){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("FLAT");
tft.setCursor(160,195);if(sub_f==1&&set==13){tft.setTextColor(0xFFFF);}else if(sub_f==1&&set!=13){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("80Hz");
tft.setCursor(220,195);if(sub_f==2&&set==13){tft.setTextColor(0xFFFF);}else if(sub_f==2&&set!=13){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("120Hz");
tft.setCursor(270,195);if(sub_f==3&&set==13){tft.setTextColor(0xFFFF);}else if(sub_f==3&&set!=13){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("160Hz");w15=0;}
//////////////////////////////////////////////////////middle q factor////////////////////////////////////////
tft.setCursor(10,210);if(set==14){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("MIDDLE Q FACTOR:");
if(pluse==HIGH&&set==14){middle_q++;if(middle_q>3){middle_q=3;}audio();w16=1;}
if(minus==HIGH&&set==14){middle_q--;if(middle_q<0){middle_q=0;}audio();w16=1;}
if(w16==1){audio();
tft.setCursor(110,210);if(middle_q==0&&set==14){tft.setTextColor(0xFFFF);}else if(middle_q==0&&set!=14){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("0.5");
tft.setCursor(160,210);if(middle_q==1&&set==14){tft.setTextColor(0xFFFF);}else if(middle_q==1&&set!=14){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("0.75");
tft.setCursor(220,210);if(middle_q==2&&set==14){tft.setTextColor(0xFFFF);}else if(middle_q==2&&set!=14){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1.0");
tft.setCursor(270,210);if(middle_q==3&&set==14){tft.setTextColor(0xFFFF);}else if(middle_q==3&&set!=14){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1.25");w16=0;}
//////////////////////////////////////////////////bass q factor////////////////////////////////////////////
tft.setCursor(10,225);if(set==15){tft.setTextColor(0xFFFF);}else{tft.setTextColor(0xcdcd);}tft.print("BASS Q FACTOR:");
if(pluse==HIGH&&set==15){bass_q++;if(bass_q>3){bass_q=3;}audio();w17=1;}
if(minus==HIGH&&set==15){bass_q--;if(bass_q<0){bass_q=0;}audio();w17=1;}
if(w17==1){audio();
tft.setCursor(110,225);if(bass_q==0&&set==15){tft.setTextColor(0xFFFF);}else if(bass_q==0&&set!=15){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1.0");
tft.setCursor(160,225);if(bass_q==1&&set==15){tft.setTextColor(0xFFFF);}else if(bass_q==1&&set!=15){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1.25");
tft.setCursor(220,225);if(bass_q==2&&set==15){tft.setTextColor(0xFFFF);}else if(bass_q==2&&set!=15){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("1.5");
tft.setCursor(270,225);if(bass_q==3&&set==15){tft.setTextColor(0xFFFF);}else if(bass_q==3&&set!=15){tft.setTextColor(0xF600);}else{tft.setTextColor(0xcdcd);}tft.print("2.0");w17=0;}
if(millis()-time>1000 && eeprom==1){
EEPROM.update(0,vol);EEPROM.update(1,treb+15);EEPROM.update(2,mid+15);EEPROM.update(3,bass+15);EEPROM.update(4,in);
EEPROM.update(5,gain1);EEPROM.update(6,gain2);EEPROM.update(7,gain3);
EEPROM.update(8,lf);EEPROM.update(9,lt);EEPROM.update(10,rf);EEPROM.update(11,rt);EEPROM.update(12,sab);
EEPROM.update(13,att_loun);EEPROM.update(14,s_loun);EEPROM.update(15,treb_c);EEPROM.update(16,middle_c);EEPROM.update(17,bass_c);
EEPROM.update(18,sub_f);EEPROM.update(19,middle_q);EEPROM.update(20,bass_q);
eeprom=0;}
times=millis()-times;
Serial.println(times);
}//loop
void sbros(){w10=1,w11=1,w12=1,w13=1,w14=1,w15=1,w16=1;w17=1;}
void audio(){
tda.setInput(in,gain,0); //вх1=1, вх2=2, вх3=3
tda.setInput2(2,0,0); // не используется
tda.setAtt_loudness(att_loun,s_loun,0,0);
tda.setSoft(mute,0,0,0,0);//mute off (не менять)
tda.setVolume(vol-79,0); // общая громкость от 0 до 79 макс
tda.setAtt_LF(79-lf,0); // гром. лк фронт
tda.setAtt_RF(79-rf,0); // гром. пк фронт
tda.setAtt_LT(79-lt,0); // гром. лк тыл
tda.setAtt_RT(79-rt,0); // гром. пк тыл
tda.setAtt_SUB(79-sab,0); // гром. савбуфер
tda.setAtt_Mix(79,0); // не используется
tda.setFilter_Treble(treb,treb_c,0);
tda.setFilter_Middle(mid,middle_q,0);
tda.setFilter_Bass(bass,bass_q,0);
tda.setSub_M_B(sub_f,middle_c,bass_c,0,0);
tda.setMix_Gain_Eff(1,0,0,0,0); // не используется
tda.setSpektor(0,0,0,0,0,0,0);
}