<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[forum.rcl-radio.ru &mdash; Расширение функционала TDA7419]]></title>
		<link>http://forum.rcl-radio.ru/viewtopic.php?id=554</link>
		<atom:link href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=554&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Расширение функционала TDA7419».]]></description>
		<lastBuildDate>Mon, 01 May 2023 08:46:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7795#p7795</link>
			<description><![CDATA[<p>Добрый день Liman324. Подскажите пожалуйста можно ли переделать скетч&nbsp; под дисплей LCD 2004,&nbsp; как на подобии аудиопроцессора BD37534FV+LCD2004+энкодер+ИК пульт.</p>]]></description>
			<author><![CDATA[null@example.com (alekc7800)]]></author>
			<pubDate>Mon, 01 May 2023 08:46:15 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7795#p7795</guid>
		</item>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7762#p7762</link>
			<description><![CDATA[<p>Да, все верно. я просто забыл память дописать.</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Thu, 20 Apr 2023 14:01:41 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7762#p7762</guid>
		</item>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7761#p7761</link>
			<description><![CDATA[<p>Здравствуйте! Протестировал скетч. При выключении питания не сохраняются настройки mid_q и bass_q. </p><p>Подскажите, что бы было сохранение в энергонезависимую память нужно дополнительно добавить в скетч bass_q = EEPROM.read(19);mid_q = EEPROM.read(20) и соответственно EEPROM.update(19,bass_q) и EEPROM.update(20,mid_q ) ?</p>]]></description>
			<author><![CDATA[null@example.com (alekc7800)]]></author>
			<pubDate>Thu, 20 Apr 2023 14:00:35 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7761#p7761</guid>
		</item>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7748#p7748</link>
			<description><![CDATA[<p>Переустановил библиотеку, все заработало. Спасибо Вам большое.</p>]]></description>
			<author><![CDATA[null@example.com (alekc7800)]]></author>
			<pubDate>Sat, 15 Apr 2023 17:50:28 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7748#p7748</guid>
		</item>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7746#p7746</link>
			<description><![CDATA[<p>Нашел ошибки в библиотеке.<br />Удалите библиотеку TDA7419 и установите ее по новой с источника - <a href="https://github.com/liman324/TDA7419">https://github.com/liman324/TDA7419</a></p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Sat, 15 Apr 2023 17:30:15 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7746#p7746</guid>
		</item>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7745#p7745</link>
			<description><![CDATA[<p>Здравствуйте! Спасибо за проделанную работу.&nbsp; Протестировал новый скетч, на дисплее настройки Q фактор сч и нч в дополнительном меню появились и меняются, но на звуковом процессоре звук не меняется, прогонял даже через программу, спектр&nbsp; Q фактор сч и нч не меняются.</p>]]></description>
			<author><![CDATA[null@example.com (alekc7800)]]></author>
			<pubDate>Sat, 15 Apr 2023 17:22:36 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7745#p7745</guid>
		</item>
		<item>
			<title><![CDATA[Re: Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7744#p7744</link>
			<description><![CDATA[<p>Тестируйте:</p><div class="codebox"><pre><code>#include &lt;Wire.h&gt;
#include &lt;TDA7419.h&gt;
#include &lt;EEPROM.h&gt;//#include &lt;EEPROMex.h&gt;
#include &lt;LiquidCrystal.h&gt;
#include &lt;Encoder.h&gt;
#include &lt;MsTimer2.h&gt;
Encoder myEnc(9, 8);//CLK, DT
TDA7419 tda; LiquidCrystal lcd(7, 6, 2, 3, 4, 5);// RS,E,D4,D5,D6,D7
  int menu,vol,bas,w,w1,vol_d,bass_d,treb,treble_d,middle,middle_d,z,in,gain0,gain1,gain2,gain3,gain_d,set;
  int lon, lon_f, lon_d,out,vol_out,rf,lf,rt,lt,sab,treb_c,mid_c,bas_c,sab_f,mute=1,vol_ram;
  unsigned long time, oldPosition  = -999,time1;
  byte a1[8]={0b00000,0b11011,0b11011,0b11011,0b11011,0b11011,0b11011,0b00000};
  byte a2[8]={0b00000,0b11000,0b11000,0b11000,0b11000,0b11000,0b11000,0b00000};
  int bass_q, mid_q;

void setup(){
lcd.begin(16, 2);lcd.createChar(0,a1); lcd.createChar(1,a2);Wire.begin();Serial.begin(9600);
  pinMode(13,INPUT);// set
  pinMode(12,INPUT);// меню
  pinMode(11,INPUT);// плюс
  pinMode(10,INPUT);// минус
  pinMode(A0,INPUT);// КНОПКА ЭНКОДЕРА
   vol = EEPROM.read(0);treb = EEPROM.read(1)-15;middle = EEPROM.read(3)-15;bas = EEPROM.read(3)-15;
   in = EEPROM.read(4);gain1 = EEPROM.read(5);gain2 = EEPROM.read(6);gain3 = EEPROM.read(7);
   lon = EEPROM.read(8);lon_f = EEPROM.read(9);rf = EEPROM.read(10);lf = EEPROM.read(11);
   rt = EEPROM.read(12);lt = EEPROM.read(13);sab = EEPROM.read(14);treb_c = EEPROM.read(15);
   mid_c = EEPROM.read(16);bas_c = EEPROM.read(17);sab_f = EEPROM.read(18);
    MsTimer2::set(1, to_Timer);MsTimer2::start();
   audio();
}
long newPosition;

void to_Timer(){ //функция таймера
newPosition = myEnc.read()/4;

}
void loop(){
  if((analogRead(A0)&lt;900||digitalRead(12)==HIGH)&amp;&amp;menu&lt;4){menu++;cl();myEnc.write(0);time=millis();w1=1;if(menu&gt;3){menu=0;}}// меню
  if(digitalRead(12)==HIGH&amp;&amp;menu&gt;=4){menu++;cl();myEnc.write(0);time=millis();w1=1;if(menu&gt;12){menu=0;}}// меню 2
  if(digitalRead(12)==HIGH&amp;&amp;digitalRead(13)==HIGH){menu=4;cl();}
   if(digitalRead(10)==HIGH&amp;&amp;digitalRead(11)==HIGH){mute++;w=1;if(mute&gt;1){mute=0;}}
//////////////////////////////////////// Volume -80 ... 0 дБ //////////////////////////////////////
if(menu==0){
    if (newPosition != oldPosition) {
    oldPosition = newPosition;
    vol=vol+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(vol&gt;80){vol=80;}if(vol&lt;0){vol=0;}}

   if(digitalRead(11)==HIGH){vol++;w=1;if(vol&gt;80){vol=80;}}// 80 максимальная громкость 
   if(digitalRead(10)==HIGH){vol--;w=1;if(vol&lt;0){vol=0;}}// 0 минимум громкости
   if(w==1){audio();cl();time=millis();w=0;w1=1;}
  lcd.setCursor(0,0);if(mute==1){lcd.print(&quot;Volume   &quot;);}else{lcd.print(&quot;MUTE     &quot;);}
  lcd.print(-80+vol);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);vol_d=vol/2-17;
   if(vol_d&gt;=0){for(z=0;z&lt;=vol_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}
   if((vol_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}
  lcd.setCursor(13,1);lcd.print(vol);}
/////////////////////////////////////////////////////////////////////////////////////
  /////////////////////// индикация тембр ВЧ + управление кнопками -15...15 дБ ///////////////////
   if(menu==1){
     if (newPosition != oldPosition) {
    oldPosition = newPosition;
    treb=treb+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(treb&gt;15){treb=15;}if(treb&lt;-15){treb=-15;}}

   if(digitalRead(11)==HIGH){treb++;w=1;if(treb&gt;15){treb=15;}}
   if(digitalRead(10)==HIGH){treb--;w=1;if(treb&lt;-15){treb=-15;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Treble   &quot;);
  lcd.print(treb);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);treble_d=treb+15;
   if(treble_d&gt;=0){for(z=0;z&lt;=treble_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}
   if((treble_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////// индикация тембр CЧ + управление кнопками -15...15 дБ ///////////////////
   if(menu==2){
      if (newPosition != oldPosition) {
    oldPosition = newPosition;
    middle=middle+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(middle&gt;15){middle=15;}if(middle&lt;-15){middle=-15;}}

   if(digitalRead(11)==HIGH){middle++;w=1;if(middle&gt;15){middle=15;}}
   if(digitalRead(10)==HIGH){middle--;w=1;if(middle&lt;-15){middle=-15;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Middle   &quot;);
  lcd.print(middle);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);middle_d=middle+15;
   if(middle_d&gt;=0){for(z=0;z&lt;=middle_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}
   if((middle_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////// индикация тембр НЧ + управление кнопками -15...15 дБ ///////////////////
   if(menu==3){
    if (newPosition != oldPosition) {
    oldPosition = newPosition;
    bas=bas+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(bas&gt;15){bas=15;}if(bas&lt;-15){bas=-15;}}   

   if(digitalRead(11)==HIGH){bas++;w=1;if(bas&gt;15){bas=15;}}
   if(digitalRead(10)==HIGH){bas--;w=1;if(bas&lt;-15){bas=-15;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Bass      &quot;);
  lcd.print(bas);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);bass_d=bas+15;
   if(bass_d&gt;=0){for(z=0;z&lt;=bass_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}
   if((bass_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}}
////////////////////////////////////////////////////////////////////////////////////
///////////////////////////// вход 1...3 + предусилитель 0...15 дБ //////////////////////////////
   if(menu==4){  //рег. предусилителя - нажать и удерживать кнопку set, рег. кнопки плюс и минус
   if(digitalRead(11)==HIGH&amp;&amp;digitalRead(13)==LOW){in++;w=1;if(in&gt;3){in=3;}}
   if(digitalRead(10)==HIGH&amp;&amp;digitalRead(13)==LOW){in--;w=1;if(in&lt;1){in=1;}}
   if(in==1){gain0=gain1;}if(in==2){gain0=gain2;}if(in==3){gain0=gain3;}
   if(digitalRead(13)==HIGH&amp;&amp;digitalRead(11)==HIGH){gain0++;w=1;if(gain0&gt;15){gain0=15;}}
   if(digitalRead(13)==HIGH&amp;&amp;digitalRead(10)==HIGH){gain0--;w=1;if(gain0&lt;0){gain0=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Input: &quot;);lcd.print(in);gain_d=gain0;
   if(gain_d&gt;=0){for(z=0;z&lt;=gain_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}
   if((gain_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}
   if(in==1){gain1=gain0;}if(in==2){gain2=gain0;}if(in==3){gain3=gain0;}
   lcd.setCursor(11,1);lcd.print(gain0);lcd.print(&quot; dB  &quot;);}
/////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// loudness ////////////////////////////////////////////////////
if(menu==5){ 
   if(digitalRead(11)==HIGH&amp;&amp;digitalRead(13)==LOW){lon_f++;w=1;if(lon_f&gt;3){lon_f=3;}}
   if(digitalRead(10)==HIGH&amp;&amp;digitalRead(13)==LOW){lon_f--;w=1;if(lon_f&lt;0){lon_f=0;}}
   if(digitalRead(13)==HIGH&amp;&amp;digitalRead(11)==HIGH){lon++;w=1;if(lon&gt;15){lon=15;}}
   if(digitalRead(13)==HIGH&amp;&amp;digitalRead(10)==HIGH){lon--;w=1;if(lon&lt;0){lon=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}lon_d=lon;
  lcd.setCursor(0,0);lcd.print(&quot;Loudness: &quot;);
   switch(lon_f){case 0: lcd.print(&quot;FLAT&quot;);break;case 1: lcd.print(&quot;400Hz&quot;);break;
   case 2: lcd.print(&quot;800Hz&quot;);break;case 3: lcd.print(&quot;2400Hz&quot;);break;}
   lcd.setCursor(0,1);
    if(lon_d&gt;=0){for(z=0;z&lt;=lon_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}
   if((lon_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}
   lcd.setCursor(9,1);lcd.print(&quot;-&quot;);lcd.print(lon);lcd.print(&quot; dB  &quot;);}
////////////////////////////////////////// out /////////////////////////////////////////////////
if(menu==6){ 
   if(digitalRead(11)==HIGH&amp;&amp;digitalRead(13)==LOW){out++;w=1;if(out&gt;4){out=4;}}
   if(digitalRead(10)==HIGH&amp;&amp;digitalRead(13)==LOW){out--;w=1;if(out&lt;0){out=0;}}
    switch(out){case 0:vol_out=rf;break;case 1:vol_out=lf;break;case 2:vol_out=rt;break;
   case 3:vol_out=lt;break;case 4:vol_out=sab;break;}
   if(digitalRead(13)==HIGH&amp;&amp;digitalRead(11)==HIGH){vol_out++;w=1;if(vol_out&gt;15){vol_out=15;}}
   if(digitalRead(13)==HIGH&amp;&amp;digitalRead(10)==HIGH){vol_out--;w=1;if(vol_out&lt;0){vol_out=0;}}
   lcd.setCursor(0,0);lcd.print(&quot;Volume OUT&quot;);lcd.setCursor(0,1);
    switch(out){
   case 0:rf=vol_out;lcd.print(&quot;RF:  +&quot;);lcd.print(rf);break;
   case 1:lf=vol_out;lcd.print(&quot;LF:  +&quot;);lcd.print(lf);break;
   case 2:rt=vol_out;lcd.print(&quot;RT:  +&quot;);lcd.print(rt);break;
   case 3:lt=vol_out;lcd.print(&quot;LT:  +&quot;);lcd.print(lt);break;
   case 4:sab=vol_out;lcd.print(&quot;SUBW:  +&quot;);lcd.print(sab);break;}
  lcd.print(&quot; dB      &quot;);if(w==1){audio();cl();time=millis();w1=1;w=0;}}
   /////////////////////////////////treble center//////////////////////////////////////////////////
if(menu==7){
if(digitalRead(11)==HIGH){treb_c++;w=1;if(treb_c&gt;3){treb_c=3;}}
   if(digitalRead(10)==HIGH){treb_c--;w=1;if(treb_c&lt;0){treb_c=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Treble Center &quot;);
  lcd.setCursor(1,6);switch(treb_c){
  case 0: lcd.print(&quot;10.0 kHz&quot;);break;case 1: lcd.print(&quot;12.5 kHz&quot;);break;
  case 2: lcd.print(&quot;15.0 kHz&quot;);break;case 3: lcd.print(&quot;17.5 kHz&quot;);break;}} 
   /////////////////////////////////middle center//////////////////////////////////////////////////
if(menu==8){
if(digitalRead(11)==HIGH){mid_c++;w=1;if(mid_c&gt;3){mid_c=3;}}
   if(digitalRead(10)==HIGH){mid_c--;w=1;if(mid_c&lt;0){mid_c=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Middle Center &quot;);
  lcd.setCursor(1,6);switch(mid_c){
  case 0: lcd.print(&quot;0.5 kHz&quot;);break;case 1: lcd.print(&quot;1.0 kHz&quot;);break;
  case 2: lcd.print(&quot;1.5 kHz&quot;);break;case 3: lcd.print(&quot;2.5 kHz&quot;);break;}}
////////////////////////////////////bass center///////////////////////////////////////////
if(menu==9){
if(digitalRead(11)==HIGH){bas_c++;w=1;if(bas_c&gt;3){bas_c=3;}}
   if(digitalRead(10)==HIGH){bas_c--;w=1;if(bas_c&lt;0){bas_c=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Bass Center &quot;);
  lcd.setCursor(1,6);switch(bas_c){
  case 0: lcd.print(&quot;60 Hz&quot;);break;case 1: lcd.print(&quot;80 Hz&quot;);break;
  case 2: lcd.print(&quot;100 Hz&quot;);break;case 3: lcd.print(&quot;200 Hz&quot;);break;}}
//////////////////////////////////////subw////////////////////////////////////////////////
if(menu==10){
if(digitalRead(11)==HIGH){sab_f++;w=1;if(sab_f&gt;3){sab_f=3;}}
   if(digitalRead(10)==HIGH){sab_f--;w=1;if(sab_f&lt;0){sab_f=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Subwoofer Freq.&quot;);
  lcd.setCursor(1,6);switch(sab_f){
  case 0: lcd.print(&quot;FLAT&quot;);break;case 1: lcd.print(&quot;80 Hz&quot;);break;
  case 2: lcd.print(&quot;120 Hz&quot;);break;case 3: lcd.print(&quot;160 Hz&quot;);break;}}
//////////////////////////////////////////////////////////////////////////////////////

if(menu==11){
if(digitalRead(11)==HIGH){mid_q++;w=1;if(mid_q&gt;3){mid_q=3;}}
   if(digitalRead(10)==HIGH){mid_q--;w=1;if(mid_q&lt;0){mid_q=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Middle Q Factor&quot;);
  lcd.setCursor(1,6);
  switch(mid_q){
    case 0: lcd.print(&quot;0.50&quot;);break;
    case 1: lcd.print(&quot;0.75&quot;);break;
    case 2: lcd.print(&quot;1.00&quot;);break;
    case 3: lcd.print(&quot;1.25&quot;);break;}}
//////////////////////////////////////////////////////////////////////////////////////

if(menu==12){
if(digitalRead(11)==HIGH){bass_q++;w=1;if(bass_q&gt;3){bass_q=3;}}
   if(digitalRead(10)==HIGH){bass_q--;w=1;if(bass_q&lt;0){bass_q=0;}}
   if(w==1){audio();cl();time=millis();w1=1;w=0;}
  lcd.setCursor(0,0);lcd.print(&quot;Bass Q Factor&quot;);
  lcd.setCursor(1,6);
  switch(bass_q){
    case 0: lcd.print(&quot;1.00&quot;);break;
    case 1: lcd.print(&quot;1.25&quot;);break;
    case 2: lcd.print(&quot;1.50&quot;);break;
    case 3: lcd.print(&quot;2.00&quot;);break;}}
/////////////////////////////////////////////////////////////////////////////////////    

Serial.println(time);

if(millis()-time&gt;10000 &amp;&amp; w1==1){
     EEPROM.update(0,vol);EEPROM.update(1,treb+15);EEPROM.update(2,middle+15);EEPROM.update(3,bas+15);
     EEPROM.update(4,in);EEPROM.update(5,gain1);EEPROM.update(6,gain2);EEPROM.update(7,gain3);
     EEPROM.update(8,lon);EEPROM.update(9,lon_f);
     EEPROM.update(10,rf);EEPROM.update(11,lf);EEPROM.update(12,rt);EEPROM.update(13,lt);
     EEPROM.update(14,sab);EEPROM.update(15,treb_c);EEPROM.update(16,mid_c);EEPROM.update(17,bas_c);
     EEPROM.update(18,sab_f);
     menu=0;w1=0; myEnc.write(0);cl();}
}//loop
void cl(){delay(300);lcd.clear();}
void audio(){
tda.setInput(in,gain0,0);    //вх1=1, вх2=2, вх3=3
tda.setInput2(0,0,0);   // не используется
tda.setAtt_loudness(lon,lon_f,0,0);
tda.setSoft(mute,0,0,0,0);//mute off (не менять)
tda.setVolume(vol-79,0);   // общая громкость от 0 до 79 макс
tda.setAtt_LF(64+lf,0);   // гром. лк фронт
tda.setAtt_RF(64+rf,0);   // гром. пк фронт
tda.setAtt_LT(64+lt,0);   // гром. лк тыл
tda.setAtt_RT(64+rt,0);   // гром. пк тыл
tda.setAtt_SUB(64+sab,0);  // гром. савбуфер
tda.setAtt_Mix(79,0);   // не использует
tda.setFilter_Treble(treb,treb_c,0);
tda.setFilter_Middle(middle,mid_q,0);
tda.setFilter_Bass(bas,bass_q,0);
tda.setSub_M_B(sab_f,mid_c,bas_c,0,0);
tda.setMix_Gain_Eff(1,0,0,0,0); // не используется
tda.setSpektor(0,0,1,0,1,0,0);
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Sat, 15 Apr 2023 05:44:28 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7744#p7744</guid>
		</item>
		<item>
			<title><![CDATA[Расширение функционала TDA7419]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=7743#p7743</link>
			<description><![CDATA[<p>Возможно ли добавить&nbsp; Q фактор для регулировки добротности фильтра сч и нч, то есть добавить дополнительных два пункта во втором меню. </p><p>#include &lt;Wire.h&gt; <br />#include &lt;TDA7419.h&gt;<br />#include &lt;EEPROM.h&gt;//#include &lt;EEPROMex.h&gt;<br />#include &lt;LiquidCrystal.h&gt;<br />#include &lt;Encoder.h&gt;<br />#include &lt;MsTimer2.h&gt;<br />Encoder myEnc(9, 8);//CLK, DT<br />TDA7419 tda; LiquidCrystal lcd(7, 6, 2, 3, 4, 5);// RS,E,D4,D5,D6,D7<br />&nbsp; int menu,vol,bas,w,w1,vol_d,bass_d,treb,treble_d,middle,middle_d,z,in,gain0,gain1,gain2,gain3,gain_d,set;<br />&nbsp; int lon, lon_f, lon_d,out,vol_out,rf,lf,rt,lt,sab,treb_c,mid_c,bas_c,sab_f,mute=1,vol_ram;<br />&nbsp; unsigned long time, oldPosition&nbsp; = -999,time1;<br />&nbsp; byte a1[8]={0b00000,0b11011,0b11011,0b11011,0b11011,0b11011,0b11011,0b00000};<br />&nbsp; byte a2[8]={0b00000,0b11000,0b11000,0b11000,0b11000,0b11000,0b11000,0b00000};</p><p>void setup(){<br /> lcd.begin(16, 2);lcd.createChar(0,a1); lcd.createChar(1,a2);Wire.begin();Serial.begin(9600);<br />&nbsp; pinMode(13,INPUT);// set<br />&nbsp; pinMode(12,INPUT);// меню<br />&nbsp; pinMode(11,INPUT);// плюс<br />&nbsp; pinMode(10,INPUT);// минус<br />&nbsp; pinMode(A0,INPUT);// КНОПКА ЭНКОДЕРА<br />&nbsp; &nbsp;vol = EEPROM.read(0);treb = EEPROM.read(1)-15;middle = EEPROM.read(3)-15;bas = EEPROM.read(3)-15;<br />&nbsp; &nbsp;in = EEPROM.read(4);gain1 = EEPROM.read(5);gain2 = EEPROM.read(6);gain3 = EEPROM.read(7);<br />&nbsp; &nbsp;lon = EEPROM.read(8);lon_f = EEPROM.read(9);rf = EEPROM.read(10);lf = EEPROM.read(11);<br />&nbsp; &nbsp;rt = EEPROM.read(12);lt = EEPROM.read(13);sab = EEPROM.read(14);treb_c = EEPROM.read(15);<br />&nbsp; &nbsp;mid_c = EEPROM.read(16);bas_c = EEPROM.read(17);sab_f = EEPROM.read(18);<br />&nbsp; &nbsp; MsTimer2::set(1, to_Timer);MsTimer2::start();<br />&nbsp; &nbsp;audio();<br />}<br />long newPosition;</p><p>void to_Timer(){ //функция таймера<br /> newPosition = myEnc.read()/4;</p><p>}<br />void loop(){<br />&nbsp; if((analogRead(A0)&lt;900||digitalRead(12)==HIGH)&amp;&amp;menu&lt;4){menu++;cl();myEnc.write(0);time=millis();w1=1;if(menu&gt;3){menu=0;}}// меню<br />&nbsp; if(digitalRead(12)==HIGH&amp;&amp;menu&gt;=4){menu++;cl();myEnc.write(0);time=millis();w1=1;if(menu&gt;10){menu=0;}}// меню 2<br />&nbsp; if(digitalRead(12)==HIGH&amp;&amp;digitalRead(13)==HIGH){menu=4;cl();}<br />&nbsp; &nbsp;if(digitalRead(10)==HIGH&amp;&amp;digitalRead(11)==HIGH){mute++;w=1;if(mute&gt;1){mute=0;}}<br />//////////////////////////////////////// Volume -80 ... 0 дБ //////////////////////////////////////<br /> if(menu==0){<br />&nbsp; &nbsp; if (newPosition != oldPosition) {<br />&nbsp; &nbsp; oldPosition = newPosition;<br />&nbsp; &nbsp; vol=vol+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(vol&gt;80){vol=80;}if(vol&lt;0){vol=0;}}</p><p>&nbsp; &nbsp;if(digitalRead(11)==HIGH){vol++;w=1;if(vol&gt;80){vol=80;}}// 80 максимальная громкость&nbsp; <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){vol--;w=1;if(vol&lt;0){vol=0;}}// 0 минимум громкости <br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w=0;w1=1;}<br />&nbsp; lcd.setCursor(0,0);if(mute==1){lcd.print(&quot;Volume&nbsp; &nbsp;&quot;);}else{lcd.print(&quot;MUTE&nbsp; &nbsp; &nbsp;&quot;);}<br />&nbsp; lcd.print(-80+vol);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);vol_d=vol/2-17;<br />&nbsp; &nbsp;if(vol_d&gt;=0){for(z=0;z&lt;=vol_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}<br />&nbsp; &nbsp;if((vol_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}<br />&nbsp; lcd.setCursor(13,1);lcd.print(vol);}<br /> /////////////////////////////////////////////////////////////////////////////////////<br />&nbsp; /////////////////////// индикация тембр ВЧ + управление кнопками -15...15 дБ ///////////////////<br />&nbsp; &nbsp;if(menu==1){<br />&nbsp; &nbsp; &nbsp;if (newPosition != oldPosition) {<br />&nbsp; &nbsp; oldPosition = newPosition;<br />&nbsp; &nbsp; treb=treb+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(treb&gt;15){treb=15;}if(treb&lt;-15){treb=-15;}} </p><p>&nbsp; &nbsp;if(digitalRead(11)==HIGH){treb++;w=1;if(treb&gt;15){treb=15;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){treb--;w=1;if(treb&lt;-15){treb=-15;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Treble&nbsp; &nbsp;&quot;);<br />&nbsp; lcd.print(treb);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);treble_d=treb+15;<br />&nbsp; &nbsp;if(treble_d&gt;=0){for(z=0;z&lt;=treble_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}<br />&nbsp; &nbsp;if((treble_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}}<br />/////////////////////////////////////////////////////////////////////////////////////<br /> /////////////////////// индикация тембр CЧ + управление кнопками -15...15 дБ ///////////////////<br />&nbsp; &nbsp;if(menu==2){<br />&nbsp; &nbsp; &nbsp; if (newPosition != oldPosition) {<br />&nbsp; &nbsp; oldPosition = newPosition;<br />&nbsp; &nbsp; middle=middle+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(middle&gt;15){middle=15;}if(middle&lt;-15){middle=-15;}} </p><p>&nbsp; &nbsp;if(digitalRead(11)==HIGH){middle++;w=1;if(middle&gt;15){middle=15;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){middle--;w=1;if(middle&lt;-15){middle=-15;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Middle&nbsp; &nbsp;&quot;);<br />&nbsp; lcd.print(middle);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);middle_d=middle+15;<br />&nbsp; &nbsp;if(middle_d&gt;=0){for(z=0;z&lt;=middle_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}<br />&nbsp; &nbsp;if((middle_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}}<br />/////////////////////////////////////////////////////////////////////////////////////<br /> /////////////////////// индикация тембр НЧ + управление кнопками -15...15 дБ ///////////////////<br />&nbsp; &nbsp;if(menu==3){<br />&nbsp; &nbsp; if (newPosition != oldPosition) {<br />&nbsp; &nbsp; oldPosition = newPosition;<br />&nbsp; &nbsp; bas=bas+newPosition;myEnc.write(0);newPosition=0;audio();lcd.clear();time=millis();w1=1;if(bas&gt;15){bas=15;}if(bas&lt;-15){bas=-15;}}&nbsp; &nbsp;</p><p>&nbsp; &nbsp;if(digitalRead(11)==HIGH){bas++;w=1;if(bas&gt;15){bas=15;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){bas--;w=1;if(bas&lt;-15){bas=-15;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Bass&nbsp; &nbsp; &nbsp; &quot;);<br />&nbsp; lcd.print(bas);lcd.setCursor(13,0);lcd.print(&quot;dB&quot;);bass_d=bas+15;<br />&nbsp; &nbsp;if(bass_d&gt;=0){for(z=0;z&lt;=bass_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}<br />&nbsp; &nbsp;if((bass_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}}<br /> ////////////////////////////////////////////////////////////////////////////////////<br /> ///////////////////////////// вход 1...3 + предусилитель 0...15 дБ //////////////////////////////<br />&nbsp; &nbsp;if(menu==4){&nbsp; //рег. предусилителя - нажать и удерживать кнопку set, рег. кнопки плюс и минус<br />&nbsp; &nbsp;if(digitalRead(11)==HIGH&amp;&amp;digitalRead(13)==LOW){in++;w=1;if(in&gt;3){in=3;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH&amp;&amp;digitalRead(13)==LOW){in--;w=1;if(in&lt;1){in=1;}}<br />&nbsp; &nbsp;if(in==1){gain0=gain1;}if(in==2){gain0=gain2;}if(in==3){gain0=gain3;}<br />&nbsp; &nbsp;if(digitalRead(13)==HIGH&amp;&amp;digitalRead(11)==HIGH){gain0++;w=1;if(gain0&gt;15){gain0=15;}}<br />&nbsp; &nbsp;if(digitalRead(13)==HIGH&amp;&amp;digitalRead(10)==HIGH){gain0--;w=1;if(gain0&lt;0){gain0=0;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Input: &quot;);lcd.print(in);gain_d=gain0;<br />&nbsp; &nbsp;if(gain_d&gt;=0){for(z=0;z&lt;=gain_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}<br />&nbsp; &nbsp;if((gain_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}<br />&nbsp; &nbsp;if(in==1){gain1=gain0;}if(in==2){gain2=gain0;}if(in==3){gain3=gain0;}<br />&nbsp; &nbsp;lcd.setCursor(11,1);lcd.print(gain0);lcd.print(&quot; dB&nbsp; &quot;);} <br />/////////////////////////////////////////////////////////////////////////////////////////////<br />////////////////////////////// loudness ////////////////////////////////////////////////////<br /> if(menu==5){&nbsp; <br />&nbsp; &nbsp;if(digitalRead(11)==HIGH&amp;&amp;digitalRead(13)==LOW){lon_f++;w=1;if(lon_f&gt;3){lon_f=3;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH&amp;&amp;digitalRead(13)==LOW){lon_f--;w=1;if(lon_f&lt;0){lon_f=0;}}<br />&nbsp; &nbsp;if(digitalRead(13)==HIGH&amp;&amp;digitalRead(11)==HIGH){lon++;w=1;if(lon&gt;15){lon=15;}}<br />&nbsp; &nbsp;if(digitalRead(13)==HIGH&amp;&amp;digitalRead(10)==HIGH){lon--;w=1;if(lon&lt;0){lon=0;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}lon_d=lon;<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Loudness: &quot;);<br />&nbsp; &nbsp;switch(lon_f){case 0: lcd.print(&quot;FLAT&quot;);break;case 1: lcd.print(&quot;400Hz&quot;);break;<br />&nbsp; &nbsp;case 2: lcd.print(&quot;800Hz&quot;);break;case 3: lcd.print(&quot;2400Hz&quot;);break;} <br />&nbsp; &nbsp;lcd.setCursor(0,1);<br />&nbsp; &nbsp; if(lon_d&gt;=0){for(z=0;z&lt;=lon_d;z++){lcd.setCursor(z/2,1);lcd.write((uint8_t)0);}}<br />&nbsp; &nbsp;if((lon_d)%2==0){lcd.setCursor(z/2,1);lcd.write((uint8_t)1);}<br />&nbsp; &nbsp;lcd.setCursor(9,1);lcd.print(&quot;-&quot;);lcd.print(lon);lcd.print(&quot; dB&nbsp; &quot;);} <br />////////////////////////////////////////// out /////////////////////////////////////////////////<br /> if(menu==6){&nbsp; <br />&nbsp; &nbsp;if(digitalRead(11)==HIGH&amp;&amp;digitalRead(13)==LOW){out++;w=1;if(out&gt;4){out=4;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH&amp;&amp;digitalRead(13)==LOW){out--;w=1;if(out&lt;0){out=0;}}<br />&nbsp; &nbsp; switch(out){case 0:vol_out=rf;break;case 1:vol_out=lf;break;case 2:vol_out=rt;break;<br />&nbsp; &nbsp;case 3:vol_out=lt;break;case 4:vol_out=sab;break;}<br />&nbsp; &nbsp;if(digitalRead(13)==HIGH&amp;&amp;digitalRead(11)==HIGH){vol_out++;w=1;if(vol_out&gt;15){vol_out=15;}}<br />&nbsp; &nbsp;if(digitalRead(13)==HIGH&amp;&amp;digitalRead(10)==HIGH){vol_out--;w=1;if(vol_out&lt;0){vol_out=0;}}<br />&nbsp; &nbsp;lcd.setCursor(0,0);lcd.print(&quot;Volume OUT&quot;);lcd.setCursor(0,1);<br />&nbsp; &nbsp; switch(out){<br />&nbsp; &nbsp;case 0:rf=vol_out;lcd.print(&quot;RF:&nbsp; +&quot;);lcd.print(rf);break;<br />&nbsp; &nbsp;case 1:lf=vol_out;lcd.print(&quot;LF:&nbsp; +&quot;);lcd.print(lf);break;<br />&nbsp; &nbsp;case 2:rt=vol_out;lcd.print(&quot;RT:&nbsp; +&quot;);lcd.print(rt);break;<br />&nbsp; &nbsp;case 3:lt=vol_out;lcd.print(&quot;LT:&nbsp; +&quot;);lcd.print(lt);break;<br />&nbsp; &nbsp;case 4:sab=vol_out;lcd.print(&quot;SUBW:&nbsp; +&quot;);lcd.print(sab);break;}<br />&nbsp; lcd.print(&quot; dB&nbsp; &nbsp; &nbsp; &quot;);if(w==1){audio();cl();time=millis();w1=1;w=0;}}<br />&nbsp; &nbsp;/////////////////////////////////treble center//////////////////////////////////////////////////<br /> if(menu==7){ <br /> if(digitalRead(11)==HIGH){treb_c++;w=1;if(treb_c&gt;3){treb_c=3;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){treb_c--;w=1;if(treb_c&lt;0){treb_c=0;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Treble Center &quot;);<br />&nbsp; lcd.setCursor(1,6);switch(treb_c){<br />&nbsp; case 0: lcd.print(&quot;10.0 kHz&quot;);break;case 1: lcd.print(&quot;12.5 kHz&quot;);break;<br />&nbsp; case 2: lcd.print(&quot;15.0 kHz&quot;);break;case 3: lcd.print(&quot;17.5 kHz&quot;);break;}}&nbsp; <br />&nbsp; &nbsp;/////////////////////////////////middle center//////////////////////////////////////////////////<br /> if(menu==8){ <br /> if(digitalRead(11)==HIGH){mid_c++;w=1;if(mid_c&gt;3){mid_c=3;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){mid_c--;w=1;if(mid_c&lt;0){mid_c=0;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Middle Center &quot;);<br />&nbsp; lcd.setCursor(1,6);switch(mid_c){<br />&nbsp; case 0: lcd.print(&quot;0.5 kHz&quot;);break;case 1: lcd.print(&quot;1.0 kHz&quot;);break;<br />&nbsp; case 2: lcd.print(&quot;1.5 kHz&quot;);break;case 3: lcd.print(&quot;2.5 kHz&quot;);break;}}<br />////////////////////////////////////bass center/////////////////////////////////////////// <br /> if(menu==9){ <br /> if(digitalRead(11)==HIGH){bas_c++;w=1;if(bas_c&gt;3){bas_c=3;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){bas_c--;w=1;if(bas_c&lt;0){bas_c=0;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Bass Center &quot;);<br />&nbsp; lcd.setCursor(1,6);switch(bas_c){<br />&nbsp; case 0: lcd.print(&quot;60 Hz&quot;);break;case 1: lcd.print(&quot;80 Hz&quot;);break;<br />&nbsp; case 2: lcd.print(&quot;100 Hz&quot;);break;case 3: lcd.print(&quot;200 Hz&quot;);break;}}<br />//////////////////////////////////////subw//////////////////////////////////////////////// <br /> if(menu==10){ <br /> if(digitalRead(11)==HIGH){sab_f++;w=1;if(sab_f&gt;3){sab_f=3;}} <br />&nbsp; &nbsp;if(digitalRead(10)==HIGH){sab_f--;w=1;if(sab_f&lt;0){sab_f=0;}}<br />&nbsp; &nbsp;if(w==1){audio();cl();time=millis();w1=1;w=0;}<br />&nbsp; lcd.setCursor(0,0);lcd.print(&quot;Subwoofer Freq.&quot;);<br />&nbsp; lcd.setCursor(1,6);switch(sab_f){<br />&nbsp; case 0: lcd.print(&quot;FLAT&quot;);break;case 1: lcd.print(&quot;80 Hz&quot;);break;<br />&nbsp; case 2: lcd.print(&quot;120 Hz&quot;);break;case 3: lcd.print(&quot;160 Hz&quot;);break;}}<br />//////////////////////////////////////////////////////////////////////////////////////</p><p>Serial.println(time);</p><p> if(millis()-time&gt;10000 &amp;&amp; w1==1){<br />&nbsp; &nbsp; &nbsp;EEPROM.update(0,vol);EEPROM.update(1,treb+15);EEPROM.update(2,middle+15);EEPROM.update(3,bas+15);<br />&nbsp; &nbsp; &nbsp;EEPROM.update(4,in);EEPROM.update(5,gain1);EEPROM.update(6,gain2);EEPROM.update(7,gain3);<br />&nbsp; &nbsp; &nbsp;EEPROM.update(8,lon);EEPROM.update(9,lon_f);<br />&nbsp; &nbsp; &nbsp;EEPROM.update(10,rf);EEPROM.update(11,lf);EEPROM.update(12,rt);EEPROM.update(13,lt);<br />&nbsp; &nbsp; &nbsp;EEPROM.update(14,sab);EEPROM.update(15,treb_c);EEPROM.update(16,mid_c);EEPROM.update(17,bas_c);<br />&nbsp; &nbsp; &nbsp;EEPROM.update(18,sab_f);<br />&nbsp; &nbsp; &nbsp;menu=0;w1=0; myEnc.write(0);cl();}<br />}//loop<br /> void cl(){delay(300);lcd.clear();}<br /> void audio(){<br />tda.setInput(in,gain0,0);&nbsp; &nbsp; //вх1=1, вх2=2, вх3=3<br />tda.setInput2(0,0,0);&nbsp; &nbsp;// не используется<br />tda.setAtt_loudness(lon,lon_f,0,0);<br />tda.setSoft(mute,0,0,0,0);//mute off (не менять)<br />tda.setVolume(vol-79,0);&nbsp; &nbsp;// общая громкость от 0 до 79 макс<br />tda.setAtt_LF(64+lf,0);&nbsp; &nbsp;// гром. лк фронт<br />tda.setAtt_RF(64+rf,0);&nbsp; &nbsp;// гром. пк фронт<br />tda.setAtt_LT(64+lt,0);&nbsp; &nbsp;// гром. лк тыл<br />tda.setAtt_RT(64+rt,0);&nbsp; &nbsp;// гром. пк тыл<br />tda.setAtt_SUB(64+sab,0);&nbsp; // гром. савбуфер<br />tda.setAtt_Mix(79,0);&nbsp; &nbsp;// не использует<br />tda.setFilter_Treble(treb,treb_c,0); <br />tda.setFilter_Middle(middle,0,0);<br />tda.setFilter_Bass(bas,0,0);<br />tda.setSub_M_B(sab_f,mid_c,bas_c,0,0);<br />tda.setMix_Gain_Eff(1,0,0,0,0); // не используется<br />tda.setSpektor(0,0,1,0,1,0,0);<br />}</p>]]></description>
			<author><![CDATA[null@example.com (alekc7800)]]></author>
			<pubDate>Fri, 14 Apr 2023 15:12:38 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=7743#p7743</guid>
		</item>
	</channel>
</rss>
