<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[forum.rcl-radio.ru &mdash; ИЛТ4-30М]]></title>
	<link rel="self" href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=596&amp;type=atom" />
	<updated>2024-05-02T10:26:13Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.rcl-radio.ru/viewtopic.php?id=596</id>
		<entry>
			<title type="html"><![CDATA[Re: ИЛТ4-30М]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10347#p10347" />
			<content type="html"><![CDATA[<p>Делал так, работает быстро, но элементы засвечиваются не ярко, ну видимо так и будет, потестирую ещё потом. Спасибо)</p>]]></content>
			<author>
				<name><![CDATA[Dimas_69]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2458</uri>
			</author>
			<updated>2024-05-02T10:26:13Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10347#p10347</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ИЛТ4-30М]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10346#p10346" />
			<content type="html"><![CDATA[<p>Уменьшите значение <br />delay(50);<br />до 1-10 мс</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2024-05-02T00:07:16Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10346#p10346</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ИЛТ4-30М]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=10345#p10345" />
			<content type="html"><![CDATA[<p>Здравствуйте,повторил ваш индикатор,работает. Но заметил что скорость срабатывания низкая,как ее повысить?<br />Заметил что есть какая то зависимость от частоты сигнала,подаю на вход синус 40Гц и индикатор на двух каналах плавно нарастает до уровня,потом затухает и так по кругу с частотой 1 раз в секунду. Можно ли сделать чтобы он не прыгал а держался на одном уровне и только сетки переключались ? собирал кстати на ардуино нано,может подправить можно чего нибудь? Буду очень благодарен)</p>]]></content>
			<author>
				<name><![CDATA[Dimas_69]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2458</uri>
			</author>
			<updated>2024-05-01T18:14:07Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=10345#p10345</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ИЛТ4-30М]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=8979#p8979" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>// LGT8F328

// сетки
#define SETKA_0   2
#define SETKA_1   3
// аноды
#define P1        4
#define P2        5
#define P3        6
#define P4        7
#define P5        8
#define P6        10
#define P7        11
#define P8        12
#define P9        13
#define P10       A0
#define P11       A1
#define P12       A2
#define P13       A3
#define P14       A4  
// входы аудио
#define AN_R      A6
#define AN_L      A7 

#define  LOW_IN    2
#define  HIGH_IN   50

byte h;
int r_in,l_in,r,l;
int ur_l,urr_l,ur_r,urr_r;

void setup(){
  Serial.begin(9600);
  noInterrupts();
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1 = 0;
  TCCR1A = (1 &lt;&lt; COM1A1)|(1 &lt;&lt; WGM11);
  TCCR1B = (1 &lt;&lt; WGM13)|(1 &lt;&lt; WGM12)|(1 &lt;&lt; CS10);
  DDRB =  1 &lt;&lt; DDB1; // OUTPUT PWM (OCR1A)
  OCR1A = 15;
  ICR1 = 40;
/////
  TCCR2A = 0;
  TCCR2B = 0;
  TCNT2 = 0; 
  OCR2A = 77;
  TCCR2A |= (1 &lt;&lt; WGM21);
  TCCR2B |= (1 &lt;&lt; CS22) | (1 &lt;&lt; CS21) | (1 &lt;&lt; CS20);
  TIMSK2 |= (1 &lt;&lt; OCIE2A); 
  interrupts();
  pinMode(2,OUTPUT);pinMode(3,OUTPUT);pinMode(P1,OUTPUT);pinMode(P1,OUTPUT);pinMode(P3,OUTPUT);pinMode(P4,OUTPUT);pinMode(P5,OUTPUT);pinMode(P6,OUTPUT);pinMode(P7,OUTPUT);
  pinMode(P8,OUTPUT);pinMode(P9,OUTPUT);pinMode(P10,OUTPUT);pinMode(P11,OUTPUT);pinMode(P12,OUTPUT);pinMode(P13,OUTPUT);pinMode(P14,OUTPUT);
  pinMode(AN_R,INPUT);
  pinMode(AN_L,INPUT);
  analogReadResolution(8);
  analogReference(INTERNAL1V024);
}

void loop(){
   r_in = map(analogRead(AN_R), LOW_IN,HIGH_IN, 0, 14);
   l_in = map(analogRead(AN_L), LOW_IN,HIGH_IN, 0, 14);
   r = constrain(r_in, 0, 14);
   l = constrain(l_in, 0, 14);
   urr_l = l;
   urr_r = r;
  if(urr_l&lt;ur_l){ur_l=ur_l-1;}else{ur_l = l;}
  if(urr_r&lt;ur_r){ur_r=ur_r-1;}else{ur_r = r;}
  delay(50);
  }

ISR(TIMER2_COMPA_vect){
  switch(h){
    case 0: segm(ur_l);ch(SETKA_0,0);ch(SETKA_1,1);break;
    case 1: segm(ur_r);ch(SETKA_0,1);ch(SETKA_1,0);break;
    }
  h++;if(h&gt;1){h=0;}
  }  

void segm(int a){
  switch(a){
   case 0: ch(P1,1);ch(P2,1);ch(P3,1);ch(P4,1);ch(P5,1);ch(P6,1);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 1: ch(P1,0);ch(P2,1);ch(P3,1);ch(P4,1);ch(P5,1);ch(P6,1);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 2: ch(P1,0);ch(P2,0);ch(P3,1);ch(P4,1);ch(P5,1);ch(P6,1);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 3: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,1);ch(P5,1);ch(P6,1);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 4: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,1);ch(P6,1);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 5: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,1);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 6: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,1);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 7: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,1);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 8: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,1);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
   case 9: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,0);ch(P10,1);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
  case 10: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,0);ch(P10,0);ch(P11,1);ch(P12,1);ch(P13,1);ch(P14,1);break;
  case 11: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,0);ch(P10,0);ch(P11,0);ch(P12,1);ch(P13,1);ch(P14,1);break;
  case 12: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,0);ch(P10,0);ch(P11,0);ch(P12,0);ch(P13,1);ch(P14,1);break;
  case 13: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,0);ch(P10,0);ch(P11,0);ch(P12,0);ch(P13,0);ch(P14,1);break;
  case 14: ch(P1,0);ch(P2,0);ch(P3,0);ch(P4,0);ch(P5,0);ch(P6,0);ch(P7,0);ch(P8,0);ch(P9,0);ch(P10,0);ch(P11,0);ch(P12,0);ch(P13,0);ch(P14,0);break;
    }
  } 

void ch(int pin, int logic){digitalWrite(pin, logic);}     </code></pre></div>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2023-12-07T16:40:38Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=8979#p8979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[ИЛТ4-30М]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=8976#p8976" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>int h;

void setup(){
  noInterrupts();
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1 = 0;
  TCCR1A = 1 &lt;&lt; COM1A1 | 1 &lt;&lt; WGM11;
  TCCR1B =  1 &lt;&lt; WGM13 | 1 &lt;&lt; WGM12 | 1 &lt;&lt; CS10;
  DDRB =  1 &lt;&lt; DDB1;
  OCR1A = 15;
  ICR1 = 40;
/////
  TCCR2A = 0;
  TCCR2B = 0;
  TCNT2 = 0; 
  OCR2A = 77;
  TCCR2A |= (1 &lt;&lt; WGM21);
  TCCR2B |= (1 &lt;&lt; CS22) | (1 &lt;&lt; CS21) | (1 &lt;&lt; CS20);
  TIMSK2 |= (1 &lt;&lt; OCIE2A); 
  interrupts();
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
}

void loop(){
 
  }

ISR(TIMER2_COMPA_vect){
  switch(h){
    case 0:  digitalWrite(2,HIGH);digitalWrite(3,LOW);break;
    case 1:  digitalWrite(3,HIGH);digitalWrite(2,LOW);break;
    }
  h++;if(h&gt;1){h=0;}
  }  </code></pre></div>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2023-12-06T09:03:04Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=8976#p8976</id>
		</entry>
</feed>
