<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[forum.rcl-radio.ru &mdash; управление драйвером жк lc75823]]></title>
	<link rel="self" href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=627&amp;type=atom" />
	<updated>2024-03-28T14:41:29Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.rcl-radio.ru/viewtopic.php?id=627</id>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10004#p10004" />
			<content type="html"><![CDATA[<p>всё, завелся</p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T14:41:29Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10004#p10004</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10003#p10003" />
			<content type="html"><![CDATA[<p>Не вижу причин почему не работает, тот скетч который Вы опубликовали у меня не компилируется, похоже библиотеки разные.</p><p>Вот библиотека которую я использую - Библиотека Radio — <a href="http://rcl-radio.ru/wp-content/uploads/2018/12/radio.zip">http://rcl-radio.ru/wp-content/uploads/ … /radio.zip</a></p><div class="codebox"><pre><code>#include &lt;Wire.h&gt;
#define CLK    8 // CLK ENCODER
#define DT     7 // DT  ENCODER
#define SW     6 // SW  ENCODER

#include &lt;radio.h&gt;
#include &lt;RDA5807M.h&gt;
#include &lt;Encoder.h&gt;               
#include &lt;MsTimer2.h&gt;

#define FIX_BAND    RADIO_BAND_FM   
RDA5807M radio; 
Encoder myEnc(CLK, DT);
  
long times,oldPosition  = -999,newPosition;
int k[14]= {8750,8830,8910,8950,9120,9160,9360,9520,9800,9960,10120,10210,10370,10570};
bool radio_on_off=1;
bool start=0;
int i_radio, f_radio;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  MsTimer2::set(1, to_Timer);MsTimer2::start();
  radio.init();
  radio.debugEnable();
  radio.setVolume(15);
  radio.setMono(false);// true - MONO
  radio.setMute(false);
  f_radio = k[0];
  radio.setBandFrequency(FIX_BAND, 10370);
  delay(400);
} 

void loop(){
  if(radio_on_off==1){
   if(digitalRead(SW)==0){i_radio++;if(i_radio&gt;13){i_radio=0;}start=1;f_radio = k[i_radio]; delay(200);}
    

   if (newPosition != oldPosition){oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
     start=1; f_radio=f_radio+newPosition*10;newPosition=0;start=1;}
  
   if(start==1){radio.setBandFrequency(FIX_BAND, f_radio);delay(200);start=0;Serial.println(f_radio);}
  }
  }

  void to_Timer(){newPosition = myEnc.read()/4;}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T14:37:26Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10003#p10003</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10002#p10002" />
			<content type="html"><![CDATA[<p>Когда я запускаю тестовый скетч из библиотеки все работает. Вот скетч<br /></p><div class="codebox"><pre><code>///
/// \file  TestRDA5807M.ino
/// \brief An Arduino sketch to operate a SI4705 chip based radio using the Radio library.
///
/// \author Matthias Hertel, http://www.mathertel.de
/// \copyright Copyright (c) 2014 by Matthias Hertel.\n
/// This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
///
/// \details
/// This sketch implements a &quot;as simple as possible&quot; radio without any possibility to modify the settings after initializing the chip.\n
/// The radio chip is initialized and setup to a fixed band and frequency. These settings can be changed by modifying the
/// FIX_BAND and FIX_STATION definitions.
///
/// Open the Serial console with 57600 baud to see the current radio information.
///
/// Wiring
/// ------
/// The RDA5807M board/chip has to be connected by using the following connections:
///
/// | Signal       | Arduino UNO | ESP8266 | ESP32  | Radio chip signal |
/// | ------------ | ------------| ------- | ------ | ----------------- |
/// | VCC (red)    | 3.3V        | 3v3     | 3v3    | VCC               |
/// | GND (black)  | GND         | GND     | GND    | GND               |
/// | SCL (yellow) | A5 / SCL    | D1      | 22     | SCLK              |
/// | SDA (blue)   | A4 / SDA    | D2      | 21     | SDIO              |
///
/// The locations of the signals on the RDA5807M side depend on the board you use.
/// More documentation is available at http://www.mathertel.de/Arduino
/// Source Code is available on https://github.com/mathertel/Radio
///
/// ChangeLog:
/// ----------
/// * 05.12.2014 created.
/// * 19.05.2015 extended.

#include &lt;Arduino.h&gt;
#include &lt;Wire.h&gt;

#include &lt;radio.h&gt;
#include &lt;RDA5807M.h&gt;

// ----- Fixed settings here. -----

#define FIX_BAND RADIO_BAND_FM  ///&lt; The band that will be tuned by this sketch is FM.
#define FIX_STATION 10370        ///&lt; The station that will be tuned by this sketch is 89.30 MHz.
#define FIX_VOLUME 10           ///&lt; The volume that will be set by this sketch is level 4.

RDA5807M radio;  // Create an instance of Class for RDA5807M Chip

/// Setup a FM only radio configuration
/// with some debugging on the Serial port
void setup() {
  delay(3000);
  // open the Serial port
  Serial.begin(115200);
  Serial.println(&quot;RDA5807M Radio...&quot;);
  delay(200);

  // Enable information to the Serial port
  radio.debugEnable(true);
  radio._wireDebug(false);

  // Set FM Options for Europe
  radio.setup(RADIO_FMSPACING, RADIO_FMSPACING_100);   // for EUROPE
  radio.setup(RADIO_DEEMPHASIS, RADIO_DEEMPHASIS_50);  // for EUROPE

  // Initialize the Radio
  if (!radio.initWire(Wire)) {
    Serial.println(&quot;no radio chip found.&quot;);
    delay(4000);

  };

  // Set all radio setting to the fixed values.
  radio.setBandFrequency(FIX_BAND, FIX_STATION);
  radio.setVolume(FIX_VOLUME);
  radio.setMono(false);
  radio.setMute(false);
}  // setup


/// show the current chip data every 3 seconds.
void loop() {
  char s[12];
  radio.formatFrequency(s, sizeof(s));
  Serial.print(&quot;Station:&quot;);
  Serial.println(s);

  Serial.print(&quot;Radio:&quot;);
  radio.debugRadioInfo();

  Serial.print(&quot;Audio:&quot;);
  radio.debugAudioInfo();

  delay(3000);
}  // loop

// End.</code></pre></div>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T14:27:18Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10002#p10002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10001#p10001" />
			<content type="html"><![CDATA[<p>Нет,тишина</p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T14:25:52Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10001#p10001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10000#p10000" />
			<content type="html"><![CDATA[<p>щас усилитель подключу,и напишу</p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T14:18:48Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10000#p10000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9999#p9999" />
			<content type="html"><![CDATA[<p>радио работает?</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T14:17:15Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9999#p9999</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9998#p9998" />
			<content type="html"><![CDATA[<p>вот что у меня выводится в порт<br /><span class="postimg"><img src="http://forum.rcl-radio.ru/uploads/images/2024/03/86561a416720717613dbff3432568ed4.png" alt="http://forum.rcl-radio.ru/uploads/images/2024/03/86561a416720717613dbff3432568ed4.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T14:15:47Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9998#p9998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9997#p9997" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#include &lt;Wire.h&gt;
#define CLK    8 // CLK ENCODER
#define DT     7 // DT  ENCODER
#define SW     6 // SW  ENCODER

#include &lt;radio.h&gt;
#include &lt;RDA5807M.h&gt;
#include &lt;Encoder.h&gt;               
#include &lt;MsTimer2.h&gt;

#define FIX_BAND    RADIO_BAND_FM   
RDA5807M radio; 
Encoder myEnc(CLK, DT);
  
long times,oldPosition  = -999,newPosition;
int k[14]= {8750,8830,8910,8950,9120,9160,9360,9520,9800,9960,10120,10210,10370,10570};
bool radio_on_off=1;
bool start=0;
int i_radio, f_radio;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  MsTimer2::set(1, to_Timer);MsTimer2::start();
  radio.init();
  radio.debugEnable();
  radio.setVolume(15);
  radio.setMono(false);// true - MONO
  radio.setMute(0);
  f_radio = k[0];
  radio.setBandFrequency(FIX_BAND, 10370);
  delay(400);
} 

void loop(){
  if(radio_on_off==1){
   if(digitalRead(SW)==0){i_radio++;if(i_radio&gt;13){i_radio=0;}start=1;f_radio = k[i_radio]; delay(200);}
    

   if (newPosition != oldPosition){oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
     start=1; f_radio=f_radio+newPosition*10;newPosition=0;start=1;}
  
   if(start==1){radio.setBandFrequency(FIX_BAND, f_radio);delay(200);start=0;}
  }
  }

  void to_Timer(){newPosition = myEnc.read()/4;}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T13:13:31Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9997#p9997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9996#p9996" />
			<content type="html"><![CDATA[<p>Можете скинуть. Весь код, что бы я скопировал</p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T13:11:28Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9996#p9996</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9995#p9995" />
			<content type="html"><![CDATA[<p>Должно быть примерно следующее</p><p><span class="postimg"><img src="http://rcl-radio.ru/wp-content/uploads/2018/12/67964368638428.png" alt="http://rcl-radio.ru/wp-content/uploads/2018/12/67964368638428.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T08:44:04Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9995#p9995</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9994#p9994" />
			<content type="html"><![CDATA[<p>Если не заработает то delay(100) замените на</p><p>delay(200)<br />потом на<br />delay(300)<br />потом на<br />delay(400)</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T08:42:41Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9994#p9994</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9993#p9993" />
			<content type="html"><![CDATA[<p>В setup перед delay(100) вставьте строчку</p><p>radio.setBandFrequency(FIX_BAND, 10370);</p><p>Должно заработать радио</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T08:36:25Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9993#p9993</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9992#p9992" />
			<content type="html"><![CDATA[<p>что то не работает, выводил много чего в порт, но безуспешно, там тишина</p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T08:15:27Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9992#p9992</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9991#p9991" />
			<content type="html"><![CDATA[<p>какая переменная отвечает за частоты(что бы на дисплей вывести)?</p>]]></content>
			<author>
				<name><![CDATA[vladbuharkin20]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2352</uri>
			</author>
			<updated>2024-03-28T07:53:16Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9991#p9991</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: управление драйвером жк lc75823]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=9990#p9990" />
			<content type="html"><![CDATA[<p>Нет гарантий то будет работать, но должно.<br />Условие radio_on_off == 1 должно быть выполнено, то бы работало радио. Добавить кнопку которое бы меняло условие radio_on_off == 0 на radio_on_off == 1 и наоборот.</p><div class="codebox"><pre><code>#include &lt;Wire.h&gt;
#define CLK    8 // CLK ENCODER
#define DT     7 // DT  ENCODER
#define SW     6 // SW  ENCODER

#include &lt;radio.h&gt;
#include &lt;RDA5807M.h&gt;
#include &lt;Encoder.h&gt;               
#include &lt;MsTimer2.h&gt;

#define FIX_BAND    RADIO_BAND_FM   
RDA5807M radio; 
Encoder myEnc(CLK, DT);
  
long times,oldPosition  = -999,newPosition;
int k[14]= {8750,8830,8910,8950,9120,9160,9360,9520,9800,9960,10120,10210,10370,10570};
bool radio_on_off=1;
bool start=0;
int i_radio, f_radio;

void setup() {
  MsTimer2::set(1, to_Timer);MsTimer2::start();
  radio.init();
  radio.debugEnable();
  radio.setVolume(15);
  radio.setMono(false);// true - MONO
  radio.setMute(0);
  f_radio = k[0];
  delay(100);
} 

void loop(){
  if(radio_on_off==1){
   if(digitalRead(SW)==0){i_radio++;if(i_radio&gt;13){i_radio=0;}start=1;f_radio = k[i_radio]; delay(200);}
    

   if (newPosition != oldPosition){oldPosition = newPosition;if(newPosition&gt;1){newPosition=1;}if(newPosition&lt;-1){newPosition=-1;}
     start=1; f_radio=f_radio+newPosition*10;newPosition=0;start=1;}
  
   if(start==1){radio.setBandFrequency(FIX_BAND, f_radio);delay(100);start=0;}
  }
  }

  void to_Timer(){newPosition = myEnc.read()/4;}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-03-28T07:40:26Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=9990#p9990</id>
		</entry>
</feed>
