<?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; TDA7461]]></title>
		<link>http://forum.rcl-radio.ru/viewtopic.php?id=606</link>
		<atom:link href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=606&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «TDA7461».]]></description>
		<lastBuildDate>Sat, 24 Feb 2024 06:29:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9526#p9526</link>
			<description><![CDATA[<p>Пока небольшой тестовый скетч, регулировка громкости, тембра и входа</p><p>Пока по входу не будет решен вопрос, нет смысла дописывать скетч.</p><div class="codebox"><pre><code>#define CLK    9 // CLK ENCODER
#define DT     8 // DT  ENCODER
#define SW     10 // SW  ENCODER

#define IN     2  // BUTTON INPUT

#include &lt;Wire.h&gt; 
#include &lt;EEPROM.h&gt;
#include &lt;Encoder.h&gt;               // http://rcl-radio.ru/wp-content/uploads/2019/05/Encoder.zip
#include &lt;MsTimer2.h&gt;              // http://rcl-radio.ru/wp-content/uploads/2018/11/MsTimer2.zip
#include &lt;LiquidCrystal_I2C.h&gt;     //  http://forum.rcl-radio.ru/misc.php?action=pan_download&amp;item=45&amp;download=1
#include &lt;TDA7461.h&gt;
  TDA7461 tda;
  LiquidCrystal_I2C lcd(0x27,16,2); 
  Encoder myEnc(CLK, DT);

  byte a1[8] = {0b00000,0b10101,0b10101,0b10101,0b10101,0b10101,0b10101,0b00000};
  byte a2[8] = {0b00000,0b10100,0b10100,0b10100,0b10100,0b10100,0b10100,0b00000};
  byte a3[8] = {0b00000,0b10000,0b10000,0b10000,0b10000,0b10000,0b10000,0b00000};  
  long times,oldPosition  = -999,newPosition;
  int vol,vol_d,menu,z,z0,z1,bass,treb,in,gain0,gain1,gain2,gain3,gain4,gain5;
  bool w,w1,www;
  

void setup(){ 
 Wire.begin();Serial.begin(9600);
 lcd.init();lcd.backlight();
 MsTimer2::set(1, to_Timer);MsTimer2::start();
 pinMode(IN,INPUT_PULLUP); 
 lcd.createChar(0,a1);lcd.createChar(1,a2);lcd.createChar(2,a3);
 lcd.setCursor(4,0);lcd.print(&quot;TDA7461&quot;);
 delay(2000);lcd.clear();
 vol = EEPROM.read(0);bass = EEPROM.read(1)-7;treb = EEPROM.read(2)-7;
 gain1 = EEPROM.read(3);gain2 = EEPROM.read(4);gain3 = EEPROM.read(5);gain4 = EEPROM.read(6);gain5 = EEPROM.read(7);
 audio();
}

void loop(){
  if(digitalRead(SW)==LOW){menu++;if(menu&gt;2){menu=0;}lcd.clear();times=millis();w=1;w1=1;www=1;delay(200);}
  if(digitalRead(IN)==LOW){in++;menu=10;if(in&gt;4){in=0;}lcd.clear();times=millis();tda.setInput(in, 0, 0, gain0); w=1;w1=1;www=1;delay(200);}

/////////////// VOLUME /////////////////////////////////////////////////////////
 if(menu==0){
   if (newPosition != oldPosition){oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
   vol=vol+newPosition;myEnc.write(0);newPosition=0;times=millis();w=1;w1=1;vol_func();tda.setVolume(vol, 1);}
   
   if(w1==1){
    vol_d=map(vol,111,0,0,48);
   for(z=0,z0=0,z1=0;z&lt;=vol_d;z++,z1++){if(z1&gt;2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1,1);lcd.print(&quot;   &quot;);}}
   if(z1==3){lcd.setCursor(z0,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0,1);lcd.write((uint8_t)2);}w1=0;
     lcd.setCursor(0,0);lcd.print(&quot;VOLUME &quot;);
     lcd.setCursor(13,0);lcd.print(111-vol);lcd.print(&quot; &quot;);}
 }
////////////// BASS /////////////////////////////////////////////////////////
  if(menu==1){
   if (newPosition != oldPosition){oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
   bass=bass-newPosition;myEnc.write(0);newPosition=0;times=millis();w=1;w1=1;bass_func();tda.setBassTreb(bass, treb);}
  
   if(w1==1){
   for(z=0,z0=0,z1=0;z&lt;=(bass*2+14+1);z++,z1++){if(z1&gt;2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(F(&quot;   &quot;));}}
   if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w1=0;
   lcd.setCursor(0,0);lcd.print(F(&quot;BASS    &quot;));
   if(bass&gt;=0){lcd.print(F(&quot;+&quot;));}lcd.print(bass*2);lcd.print(&quot; &quot;);lcd.setCursor(13,0);lcd.print(F(&quot;dB&quot;));}
  }
////////////// TREB /////////////////////////////////////////////////////////
  if(menu==2){
   if (newPosition != oldPosition){oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
   treb=treb-newPosition;myEnc.write(0);newPosition=0;times=millis();w=1;w1=1;treb_func();tda.setBassTreb(bass, treb);}
  
   if(w1==1){
   for(z=0,z0=0,z1=0;z&lt;=(treb*2+14+1);z++,z1++){if(z1&gt;2){z1=0;z0++;}
   if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(F(&quot;   &quot;));}}
   if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);}
   if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w1=0;
   lcd.setCursor(0,0);lcd.print(F(&quot;TREBLE  &quot;));
   if(treb&gt;=0){lcd.print(F(&quot;+&quot;));}lcd.print(treb*2);lcd.print(&quot; &quot;);lcd.setCursor(13,0);lcd.print(F(&quot;dB&quot;));}
  }  

///// INPUT GAIN
if(menu==10){ 
   switch(in){
     case 0: gain0 = gain1;break;
     case 1: gain0 = gain2;break;
     case 2: gain0 = gain3;break;
     case 3: gain0 = gain4;break;
     case 4: gain0 = gain5;break;
     }
 
    if (newPosition != oldPosition) {oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
    gain0=gain0-newPosition;myEnc.write(0);newPosition=0;times=millis();www=1;w=1;gain_func();} 
 
   switch(in){
     case 0: gain1 = gain0;break;
     case 1: gain2 = gain0;break;
     case 2: gain3 = gain0;break;
     case 3: gain4 = gain0;break;
     case 4: gain5 = gain0;break;
     }
 
  if(www==1){www=0;tda.setInput(in, 0, 0, gain0);}
  lcd.setCursor(4,0);lcd.print(&quot;INPUT &quot;);lcd.print(in+1);lcd.setCursor(3,1);lcd.print(&quot;GAIN &quot;);lcd.print(gain0*2);lcd.print(&quot; &quot;);lcd.setCursor(10,1);lcd.print(&quot;dB &quot;);
   }  
  
//////// EEPROM //////////////////////////////////////////////////
  if(millis()-times&gt;5000 &amp;&amp; w==1){
    EEPROM.update(0,vol);EEPROM.update(1,bass+7);EEPROM.update(2,treb+7);
    EEPROM.update(3,gain1);EEPROM.update(4,gain2);EEPROM.update(5,gain3);EEPROM.update(6,gain4);EEPROM.update(7,gain5);
  w=0;menu=0;w1=1;lcd.clear();}
   
} 

void vol_func(){if(vol&gt;111){vol=111;}if(vol&lt;0){vol=0;}}
void gain_func(){if(gain0&gt;7){gain0=7;}if(gain0&lt;0){gain0=0;}}
void bass_func(){if(bass&gt;7){bass=7;}if(bass&lt;-7){bass=-7;}}
void treb_func(){if(treb&gt;7){treb=7;}if(treb&lt;-7){treb=-7;}}

void audio(){
  ///  Input selector          
     tda.setInput(in, 0, 0, gain0); 
// int source = 0...7 &gt;&gt;&gt; CD
//                        Cassette
//                        Phone
//                        AM
//                        Stereo Decoder
//                        Input FM
//                        Mute
//                        AC inputs  
// bool cd = 0...1 &gt;&gt;&gt; CD Full-differential...CD Quasi-diff   
// int am_fm = 0...3 &gt;&gt;&gt; AM mono
//                       AM stereo
//                       AM through Stereo decoder
//                       FM- Stereo decoder
// int in_gain = 0...7 &gt;&gt;&gt;  14...0 dB step 2 dB
     ///  Loudness         
     tda.setLoudness(0, 0, 0, 0); 
// int loud_att = 0...15 &gt;&gt;&gt; 0...-15 dB
// bool loud_filter = 0...1 &gt;&gt;&gt; on...off
// bool loud_f = 0...1 &gt;&gt;&gt; 200...400 Hz
// bool loud_q = 0...1 &gt;&gt;&gt; low...normal
     ///   Mute, Beep and Mixing        
     tda.setSoftmute(1, 0, 1, 0, 0, 3);    
// int mute = 0...1 &gt;&gt;&gt; Softmute = Enable...Disable 
// int mute_time 0...3 &gt;&gt; Mute time = 0.48, 0.96, 40.4, 324 ms
// bool stereo_dec = 0...1 &gt;&gt;&gt; Stereo decoder softmute influence = off...on
// bool beep = 0...1 &gt;&gt;&gt; Beep Frequency = 600 Hz...1.2 kHz
// bool mixing_0 = 0...1 &gt;&gt;&gt; Mix-Source = Beep...Phone
// bool mixing_1 = 0...3 &gt;&gt;&gt; Full Mix Signal
//                           Source -12 dB + Mix-Signal -2.5 dB
//                           Source -6 dB + Mix-Signal -6 dB
//                           Full Source
     ///   Volume       
     tda.setVolume(vol, 1); 
// int vol = 0...111 &gt;&gt;&gt; +32...-79 dB
// bool soft_step = 0...1 &gt;&gt;&gt; Soft step volume = off...on
     ///   Bass and treble attenuation       
     tda.setBassTreb(bass, treb); 
// int bass = -14...14 &gt;&gt;&gt; -14...+14 dB step 2 dB
// int treb = -14...14 &gt;&gt;&gt; -14...+14 dB step 2 dB
     ///   Bass and treble filter characteristics      
     tda.setBassTrebConf(0, 0, 0, 0, 0);
// int treb_f = 0...3 &gt;&gt;&gt; 10, 12.5, 15, 17.5 kHz
// int bass_f = 0...4 &gt;&gt;&gt; 60, 70, 80, 100, 150 Hz
// int bass_q = 0...3 &gt;&gt;&gt; 1, 1.25, 1.5, 2 
// bool dc_gain 0...1 &gt;&gt;&gt; DC-Gain = 0 dB ... ±4.4 dB
// bool ac_coupling = 0...1 &gt;&gt;&gt; For External Connection...Internally Connection
     /// ATT (LF, LR, RF, RR)
     tda.attLF(0); // int 0...31 &gt;&gt;&gt; 0...-50 dB
     tda.attLR(0); // int 0...31 &gt;&gt;&gt; 0...-50 dB
     tda.attRF(0); // int 0...31 &gt;&gt;&gt; 0...-50 dB
     tda.attRR(0); // int 0...31 &gt;&gt;&gt; 0...-50 dB
     ///  Stereo decoder
     tda.setStereo(0, 0, 0, 1, 1, 0);
// bool std = 0..1 &gt;&gt;&gt; STD unmuted...muted
// int in_gain_dec = 0...3 &gt;&gt;&gt; IN-Gain 11, 8.5, 6, 3.5 dB
// bool dec = 0...1 &gt;&gt;&gt; Stereo decoder Unmuted with Stdec. 
//                      Stereo decoder Unmuted whichever is the selected source.
// bool mono_stereo = 0...1 &gt;&gt;&gt; Forced mono...Mono/stereo switch automatically
// bool pilot = 0...1 &gt;&gt;&gt; Pilot threshold high...low
// bool emp = 0...1 &gt;&gt;&gt; De-emphasis 50...75 μs
     ///  Noise blanker
     tda.setBlanker(0, 0, 0, 3);
// int threshold_0 = 0...7 &gt;&gt;&gt; Low threshold 65, 60, 55, 50, 45, 40, 35, 30 mV
// int threshold_1 = 0...3 &gt;&gt;&gt; Noise controlled threshold 320, 260, 200, 140 mV
// bool blank = 0...1 &gt;&gt;&gt; Noise blanker off...on
// int over = 0...3 &gt;&gt;&gt; Over deviation adjust 2.8V, 2.0V, 1.2V, off
     /// Field strength control
     tda.setField(3, 0, 0, 0, 0);
// int adj = 0...3 &gt;&gt;&gt; Noise blanker Field strength Adj 2.3V, 1.8V, 1.3V, off
// int vsbl = 0...3 &gt;&gt;&gt; VSBL at 33%, 42%, 50%, 58%
// int vhch = 0...3 &gt;&gt;&gt; VHCH at 42%, 50%, 58%, 66%
// bool vhcl = 0...1 &gt;&gt;&gt; VHCL at 17%, 33%
// bool cut = 0...1 &gt;&gt;&gt; High cut OFF...ON
     /// Configuration
     tda.setConf(0, 0, 1, 3);
// int rez = 0...3 &gt;&gt;&gt; infinite, 56kOm, 33kOm, 18kOm
// int band_gain = 0...3 &gt;&gt;&gt; 6, 16, 12, 18 dB
// bool mult = 0...1 &gt;&gt;&gt; Multipath detector internal influence On...Off
// int mult_gain = 0...3 &gt;&gt;&gt; Gain = 7.6 dB 4.6 dB, 0 dB, Off
     /// Stereo decoder adjustment
     tda.setSDecoder(0,0, 1);
// int compens = 0...7 &gt;&gt;&gt; not...31%
// int level_gain = 0...15 &gt;&gt;&gt; 0...10 dB step 0.66dB
// bool temp = 0...1 &gt;&gt;&gt; TC = 0...16.7 mV/K (3300 ppm)
     /// Testing
     tda.setTest(0b11111110);
// default test = 0b11111110 (Table 25)
  }
 
void to_Timer(){newPosition = myEnc.read()/4;}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Sat, 24 Feb 2024 06:29:46 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9526#p9526</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9480#p9480</link>
			<description><![CDATA[<div class="codebox"><pre><code>#include &lt;LiquidCrystal_I2C.h&gt;
#include &lt;Wire.h&gt;
#include &lt;MsTimer2.h&gt;
#include &lt;Encoder.h&gt;
#include &lt;EEPROM.h&gt;
#include &lt;TDA7461.h&gt;

#define MUTE 10
#define SW 4 //кнопка на энкодере

TDA7461 tda;

Encoder myEnc( 3, 2 ); //CLK, DT encoder connection

LiquidCrystal_I2C lcd(0x27, 16, 2); // Set Alamat I2C LCD dan type LCD

byte a3[ 8 ] = { 0b00000, 0b00000, 0b00000, 0b11011, 0b11011, 0b00000, 0b00000, 0b00000 };

unsigned long newPosition, time, oldPosition = - 999;
int  menu, w, vol, loud, vol_d, z, bass, bass_d, treb, treb_d, in , mute, m;


// constants won&#039;t change. They&#039;re used here to set pin numbers:
//const int BUTTON_PIN = 7; // the number of the pushbutton pin
const int SHORT_PRESS_TIME = 500; // 1000 milliseconds
const int LONG_PRESS_TIME  = 500; // 1000 milliseconds

// Variables will change:
int lastState = HIGH;  // the previous state from the input pin
int currentState;     // the current reading from the input pin
unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;
bool gantian;


void setup( ) {
  tda.setSoftmute(0, 2, 0, 0, 0, 3);
  delay(300);
  Serial.begin(9600);
  Wire.begin();
audio();
  Serial.begin( 9600 );
  Wire.begin( );
  lcd.begin( 16, 2 );
  //lcd.begin();
  lcd.backlight();
  lcd.createChar( 2, a3 );
  

  pinMode( SW, INPUT_PULLUP); // ENCODER BUTTON
  pinMode( MUTE, INPUT_PULLUP ); // MUTE

  MsTimer2::set( 1, to_Timer );
  MsTimer2::start();

  vol = EEPROM.read( 0 ) - 31;
  bass = EEPROM.read( 1 ) - 10;
  treb = EEPROM.read( 2 ) - 8;
  in = EEPROM.read( 7 );
  loud = EEPROM.read ( 9 );

  for ( z = 0 ; z &lt;= 3; z++ ) {
    //tea.setBallance( z, 0 );
  }
 

  lcd.setCursor( 1, 0);
  lcd.print(&quot;-= WELCOME =-&quot;);
  lcd.setCursor( 0, 1);
  lcd.print(&quot;&gt; VlAD ver:1.1 &lt;&quot;);
  delay(2000);
  tda.setSoftmute(1, 2, 0, 0, 0, 3);
  lcd.clear( );
}

void to_Timer ( ) {
  newPosition = myEnc.read ( ) / 2 ;
}

void loop ( ) {


  // read the state of the switch/button:
  currentState = digitalRead(SW);

  if (lastState == HIGH &amp;&amp; currentState == LOW)       // button is pressed
    pressedTime = millis();
  else if (lastState == LOW &amp;&amp; currentState == HIGH) { // button is released
    releasedTime = millis();

    long pressDuration = releasedTime - pressedTime;

    if ( pressDuration &lt; SHORT_PRESS_TIME ) {
      menu ++;  // menu
      cl( );
      myEnc.write ( 0 );
      time = millis ( );
      w = 1;
      if ( menu &gt; 4 ) {
        menu = 0 ;
      }
      Serial.println(&quot;A short press is detected&quot;);
    }

    if ( pressDuration &gt; LONG_PRESS_TIME ) {
      mute++;  // mute
      if ( mute &gt; 1 ) {
        mute = 0 ;
      }
      audio ( ) ;
      cl ( ) ;
    }
    if ( mute == 1 ) {
      m = 1 ;  // mute

      lcd.setCursor( 12, 0);
      lcd.print(&quot;MUTE&quot;);
      lcd.setCursor( 0, 0);
      lcd.print( &quot;VOLUME &quot;) ;
      lcd.print( &quot;0&quot;) ;
      lcd.setCursor( 1, 1);
      lcd.print(&quot;x&quot;);
      lcd.setCursor( 0, 1);
      lcd.write(( uint8_t ) 3);
      for ( z = 3 ; z &lt;= 15; z++ ) {

      }
      menu = 100 ;
    }
    if ( mute == 0 &amp;&amp; m == 1 ) {
      cl ( );
      menu = 0 ;
      m = 0 ;
      Serial.println(&quot;A long press is detected&quot;);
    }
  } 
  lastState = currentState;
/////////////////////////////////////////////////////////////////////////////////////////(ГРОМКОСТЬ 111-0)///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if ( menu == 0 ) {
    
    if  ( newPosition != oldPosition )  {
      oldPosition = newPosition;
      vol = vol - newPosition;
      myEnc.write ( 0 );
      newPosition = 0;
      cl ( ) ;
      time = millis ( );
      w = 1 ;
      if ( vol &gt; 111 ) {
        vol = 111 ;
      }
      if ( vol &lt; 0 ) {
        vol = 0 ;
      }
      audio ( ) ;
    }

    lcd.setCursor( 7 , 0 );
    lcd.print( vol  );
    lcd.setCursor( 0 , 0 );
    lcd.print( &quot;VOLUME&quot; );
    lcd.setCursor( 11 , 0 );
    lcd.print( !vol ) ;
    lcd.print( &quot;dB&quot; ) ;
  }
/////////////////////////////////////////////////////////////////////////////////////////(ВЧ. НАСТРОЙКИ 0-14)///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if ( menu == 1 ) {
    if  ( newPosition != oldPosition )  {
      oldPosition = newPosition;
      bass = bass + newPosition;
      myEnc.write ( 0 );
      newPosition = 0;
      lcd.clear();
      time = millis();
      w = 1 ;
      if ( bass &gt; 14 ) {
        bass = 14 ;
      }
      if ( bass &lt; -14 ) {
        bass = -14 ;
      }
      audio ( ) ;
    }
    lcd. setCursor ( 0, 0 ) ;
    lcd. print ( &quot;BASS &quot; ) ;
    lcd.print( bass  );
  }
/////////////////////////////////////////////////////////////////////////////////////////(НЧ. НАСТРОЙКИ 0-14)///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if ( menu == 2 ) {
    if  ( newPosition != oldPosition )  {
      oldPosition = newPosition;
      treb = treb + newPosition;
      myEnc.write( 0 );
      newPosition = 0;
      lcd.clear();
      time = millis();
      w = 1;
      if ( treb &gt; 14 ) {
        treb = 14;
      }
      if ( treb &lt;  -14 ) {
        treb =  -14;
      }
      audio();
    }

    lcd.setCursor( 0 , 0 );
    lcd.print(&quot;TRBL &quot;);
    lcd.print( treb  );
   Serial.println(treb);
  }
/////////////////////////////////////////////////////////////////////////////////////////(LOUDNESS)///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if ( menu == 3 ) {
    if ( newPosition != oldPosition )  {
      oldPosition = newPosition;
      loud = loud + newPosition;
      myEnc.write( 0 );
      newPosition = 0;
      lcd.clear ( );
      time = millis ( );
      w = 1;
      if ( loud &gt; 1 ) {
        loud = 0;
      }
      if ( loud &lt; 0 ) {
        loud = 1;
        
      }
    }
    lcd.setCursor(2, 0);
    lcd.print(&quot;-=LOUDNESS=-&quot;);
    if (loud == 1) {
      lcd.setCursor(5, 1);
      lcd.print(&quot;&gt;&gt; ON&quot;);
    }
    else {
      lcd.setCursor(5, 1);
      lcd.print(&quot;OFF &lt;&lt;&quot;);
    }
    audio ( );
  }
/////////////////////////////////////////////////////////////////////////////////////////(ВХОДЫ АУДИО 1-7)///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if ( menu == 4 ) {
    if ( newPosition != oldPosition )  {
      oldPosition = newPosition;
      in = in + newPosition;
      myEnc.write( 0 );
      newPosition = 0;
      lcd.clear ( );
      time = millis ( );
      w = 1;
      if ( in &gt; 7 ) {
        in = 0;
      }
      if ( in &lt; 0 ) {
        in = 7;
      }
    }
    lcd.setCursor(0, 0);
    lcd.print(&quot;Source Selector:&quot;);
    lcd.setCursor(0, 1);
    lcd.print(in);
    if (in == 0){
    lcd.setCursor(2, 1);
      lcd.print(&quot;CD&quot;); 
    }
    if (in == 1){
    lcd.setCursor(2, 1);
      lcd.print(&quot;CASSETTE&quot;); 
    }
    if (in == 2){
    lcd.setCursor(2, 1);
      lcd.print(&quot;PHONE&quot;);
    }
    if (in == 3){
    lcd.setCursor(2, 1);
      lcd.print(&quot;AM&quot;);
    }
    if (in == 4){
    lcd.setCursor(2, 1);
      lcd.print(&quot;STEREO DEC&quot;);
    }
    if (in == 5){
    lcd.setCursor(2, 1);
      lcd.print(&quot;INPUT FM&quot;);
    }
    if (in == 6){
    lcd.setCursor(2, 1);
      lcd.print(&quot;MUTE&quot;);
    }
     if (in == 7){
    lcd.setCursor(2, 1);
      lcd.print(&quot;AC IN&quot;);
    }
    audio ( );
  }


  if ( millis() - time &gt; 10000  &amp;&amp; w == 1 ) {
    EEPROM.update( 0, vol + 31 );
    EEPROM.update( 1, bass + 10);
    EEPROM.update( 2, bass + 8 );
    EEPROM.update( 7, in );
    EEPROM.update( 9, loud );
    cl ( );
    menu = 0;
    w = 0;
  }
}

void cl ( ) {
  delay ( 10 ) ;
  lcd.clear ( ) ;
}

void audio ( ) {
tda.setInput(in, 1, 3, 0);
tda.setLoudness(0, loud, 0, 0); 
tda.setVolume(vol, 0);
tda.setBassTreb(bass, treb);
tda.attLF(4); // int 0...31 &gt;&gt;&gt; 0...-50 dB
tda.attRF(0);
tda.setBassTrebConf(3, 0, 0, 0, 1);
//1.   int treb_f = 0...3 &gt;&gt;&gt; 10, 12.5, 15, 17.5 kHz
//2.   int bass_f = 0...4 &gt;&gt;&gt; 60, 70, 80, 100, 150 Hz
//3.   int bass_q = 0...3 &gt;&gt;&gt; 1, 1.25, 1.5, 2 
//4.   bool dc_gain 0...1 &gt;&gt;&gt; DC-Gain = 0 dB ... ±4.4 dB
//5.   bool ac_coupling = 0...1 &gt;&gt;&gt; For External Connection...Internally Connection
tda.setStereo(0, 0, 0, 1, 1, 0);
//1.   bool std = 0..1 &gt;&gt;&gt; STD unmuted...muted
//2.   int in_gain_dec = 0...3 &gt;&gt;&gt; IN-Gain 11, 8.5, 6, 3.5 dB
//3.   bool dec = 0...1 &gt;&gt;&gt; Stereo decoder Unmuted with Stdec. 
//4.   Stereo decoder Unmuted whichever is the selected source.
//5.   bool mono_stereo = 0...1 &gt;&gt;&gt; Forced mono...Mono/stereo switch automatically
//6.   bool pilot = 0...1 &gt;&gt;&gt; Pilot threshold high...low
//7.   bool emp = 0...1 &gt;&gt;&gt; De-emphasis 50...75 μs
   ///  Noise blanker
tda.setBlanker(0, 0, 0, 3);
//1.   int threshold_0 = 0...7 &gt;&gt;&gt; Low threshold 65, 60, 55, 50, 45, 40, 35, 30 mV
//2.   int threshold_1 = 0...3 &gt;&gt;&gt; Noise controlled threshold 320, 260, 200, 140 mV
//3.   bool blank = 0...1 &gt;&gt;&gt; Noise blanker off...on
//4.   int over = 0...3 &gt;&gt;&gt; Over deviation adjust 2.8V, 2.0V, 1.2V, off
             /// Field strength control
tda.setField(3, 0, 0, 0, 0);
//1.   int adj = 0...3 &gt;&gt;&gt; Noise blanker Field strength Adj 2.3V, 1.8V, 1.3V, off
//2.   int vsbl = 0...3 &gt;&gt;&gt; VSBL at 33%, 42%, 50%, 58%
//3.   int vhch = 0...3 &gt;&gt;&gt; VHCH at 42%, 50%, 58%, 66%
//4.   bool vhcl = 0...1 &gt;&gt;&gt; VHCL at 17%, 33%
//5.   bool cut = 0...1 &gt;&gt;&gt; High cut OFF...ON
     /// Configuration
 tda.setConf(0, 0, 1, 3);
//1.   int rez = 0...3 &gt;&gt;&gt; infinite, 56kOm, 33kOm, 18kOm
//2.   int band_gain = 0...3 &gt;&gt;&gt; 6, 16, 12, 18 dB
//3.   bool mult = 0...1 &gt;&gt;&gt; Multipath detector internal influence On...Off
//4.   int mult_gain = 0...3 &gt;&gt;&gt; Gain = 7.6 dB 4.6 dB, 0 dB, Off
     /// Stereo decoder adjustment
tda.setSDecoder(4, 0, 1);
//1.   int compens = 0...7 &gt;&gt;&gt; not...31%
//2.   int level_gain = 0...15 &gt;&gt;&gt; 0...10 dB step 0.66dB
//3.   bool temp = 0...1 &gt;&gt;&gt; TC = 0...16.7 mV/K (3300 ppm)
tda.setTest(0b11111110);  
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (vladbuharkin20)]]></author>
			<pubDate>Sat, 17 Feb 2024 07:30:16 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9480#p9480</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9477#p9477</link>
			<description><![CDATA[<p>///&nbsp; Input selector&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;tda.setInput(0, 0, 0, 0); <br />// int source = 0...7 &gt;&gt;&gt; CD<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cassette<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Phone<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AM<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stereo Decoder<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Input FM<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mute<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AC inputs&nbsp; <br />// bool cd = 0...1 &gt;&gt;&gt; CD Full-differential...CD Quasi-diff&nbsp; &nbsp;<br />// int am_fm = 0...3 &gt;&gt;&gt; AM mono<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AM stereo<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AM through Stereo decoder<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FM- Stereo decoder<br />// int in_gain = 0...15 &gt;&gt;&gt;&nbsp; 14...0 dB step 2 dB</p><p>надо поменять вот этот параметр - bool cd = 0...1 &gt;&gt;&gt; CD Full-differential...CD Quasi-diff</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 14:23:24 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9477#p9477</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9476#p9476</link>
			<description><![CDATA[<p><a href="http://rcl-radio.ru/?p=62674">http://rcl-radio.ru/?p=62674</a></p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 14:08:11 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9476#p9476</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9475#p9475</link>
			<description><![CDATA[<p>tda.setBassTrebConf(0, 0, 0, 1, 1);<br />// int treb_f = 0...3 &gt;&gt;&gt; 10, 12.5, 15, 17.5 kHz<br />// int bass_f = 0...4 &gt;&gt;&gt; 60, 70, 80, 100, 150 Hz<br />// int bass_q = 0...3 &gt;&gt;&gt; 1, 1.25, 1.5, 2 <br />// bool dc_gain 0...1 &gt;&gt;&gt; DC-Gain = 0 dB ... ±4.4 dB<br />// bool ac_coupling = 0...1 &gt;&gt;&gt; For External Connection...Internally Connection</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 14:04:23 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9475#p9475</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9474#p9474</link>
			<description><![CDATA[<p>Отключение тон компенсации</p><p>&nbsp; &nbsp; &nbsp;tda.setLoudness(0, 1, 0, 0); <br />// int loud_att = 0...15 &gt;&gt;&gt; 0...-15 dB<br />// bool loud_filter = 0...1 &gt;&gt;&gt; on...off<br />// bool loud_f = 0...1 &gt;&gt;&gt; 200...400 Hz<br />// bool loud_q = 0...1 &gt;&gt;&gt; low...normal</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 13:42:09 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9474#p9474</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9473#p9473</link>
			<description><![CDATA[<p>void setup(){ <br />&nbsp; Serial.begin(9600);<br />&nbsp; Wire.begin();<br />}</p><p>void loop(){<br />&nbsp; audio();<br />&nbsp; delay(1000);<br />}</p><p>поменять на </p><p>void setup(){ <br />&nbsp; delay(300);<br />&nbsp; Serial.begin(9600);<br />&nbsp; Wire.begin();<br />audio();<br />}</p><p>void loop(){<br />&nbsp; <br />&nbsp; delay(1000);<br />}</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 13:27:00 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9473#p9473</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9472#p9472</link>
			<description><![CDATA[<p>tda.setBassTreb(0, 0); <br />// int bass = -14...14 &gt;&gt;&gt; -14...+14 dB step 2 dB<br />// int treb = -14...14 &gt;&gt;&gt; -14...+14 dB step 2 dB</p><p> tda.setBassTreb(14, 0); <br />// int bass = -14...14 &gt;&gt;&gt; -14...+14 dB step 2 dB<br />// int treb = -14...14 &gt;&gt;&gt; -14...+14 dB step 2 dB</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 13:24:17 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9472#p9472</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9468#p9468</link>
			<description><![CDATA[<p>tda.setSoftmute(1, 0, 0, 0, 0, 3);&nbsp; &nbsp; <br />// int mute = 0...1 &gt;&gt;&gt; Softmute = Enable...Disable <br />// int mute_time 0...3 &gt;&gt; Mute time = 0.48, 0.96, 40.4, 324 ms<br />// bool stereo_dec = 0...1 &gt;&gt;&gt; Stereo decoder softmute influence = off...on<br />// bool beep = 0...1 &gt;&gt;&gt; Beep Frequency = 600 Hz...1.2 kHz<br />// bool mixing_0 = 0...1 &gt;&gt;&gt; Mix-Source = Beep...Phone<br />// bool mixing_1 = 0...3 &gt;&gt;&gt; Full Mix Signal<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Source -12 dB + Mix-Signal -2.5 dB<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Source -6 dB + Mix-Signal -6 dB<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Full Source</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Fri, 16 Feb 2024 05:12:11 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9468#p9468</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9462#p9462</link>
			<description><![CDATA[<p>tda.setInput(0, 1, 3, 15); <br />// int source = 0...7 &gt;&gt;&gt; CD<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cassette<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Phone<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AM<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stereo Decoder<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Input FM<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mute<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AC inputs&nbsp; <br />// bool cd = 0...1 &gt;&gt;&gt; CD Full-differential...CD Quasi-diff&nbsp; &nbsp;<br />// int am_fm = 0...3 &gt;&gt;&gt; AM mono<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AM stereo<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AM through Stereo decoder<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FM- Stereo decoder<br />// int in_gain = 0...15 &gt;&gt;&gt;&nbsp; 14...0 dB step 2 dB</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Thu, 15 Feb 2024 11:25:53 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9462#p9462</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9461#p9461</link>
			<description><![CDATA[<p>я так полагаю что дело в этом узле. Где-то здесь блокируется сигнал. <br /><span class="postimg"><img src="http://forum.rcl-radio.ru/uploads/images/2024/02/1e5733092c8830fb4b023e431a4d115d.png" alt="http://forum.rcl-radio.ru/uploads/images/2024/02/1e5733092c8830fb4b023e431a4d115d.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (vladbuharkin20)]]></author>
			<pubDate>Wed, 14 Feb 2024 18:57:49 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9461#p9461</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9460#p9460</link>
			<description><![CDATA[<p>Перепроверил всю библиотеку, ошибок не нашел. Перевел весь даташит, не могу понять почему не работает.<br />Пока идей нет, буду думать.<br />Но все же скорее всего один или несколько из параметров не дает возможность запустить звук.</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Wed, 14 Feb 2024 15:52:59 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9460#p9460</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9459#p9459</link>
			<description><![CDATA[<p>все параметры менял, ничего не помогло. Проблема&nbsp; в том что нету звука на ножках ACOUT. Нужно искать почему</p>]]></description>
			<author><![CDATA[null@example.com (vladbuharkin20)]]></author>
			<pubDate>Wed, 14 Feb 2024 14:46:55 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9459#p9459</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9458#p9458</link>
			<description><![CDATA[<p>можете ли вы дать свой телеграм или другое средство связи, там подробнее все опишу. И дело лучше и быстрее пойдет</p>]]></description>
			<author><![CDATA[null@example.com (vladbuharkin20)]]></author>
			<pubDate>Wed, 14 Feb 2024 14:35:53 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9458#p9458</guid>
		</item>
		<item>
			<title><![CDATA[Re: TDA7461]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=9457#p9457</link>
			<description><![CDATA[<p>tda.setBassTrebConf(0, 0, 0, 0, 0);<br />// int treb_f = 0...3 &gt;&gt;&gt; 10, 12.5, 15, 17.5 kHz<br />// int bass_f = 0...4 &gt;&gt;&gt; 60, 70, 80, 100, 150 Hz<br />// int bass_q = 0...3 &gt;&gt;&gt; 1, 1.25, 1.5, 2 <br />// bool dc_gain 0...1 &gt;&gt;&gt; DC-Gain = 0 dB ... ±4.4 dB<br />// bool ac_coupling = 0...1 &gt;&gt;&gt; For External Connection...Internally Connection<br />попробуйте так</p><p>&nbsp; tda.setBassTrebConf(0, 0, 0, 0, 1);</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Wed, 14 Feb 2024 14:32:24 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=9457#p9457</guid>
		</item>
	</channel>
</rss>
