<?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; Ступенчатая регулировка]]></title>
		<link>http://forum.rcl-radio.ru/viewtopic.php?id=452</link>
		<atom:link href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=452&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Ступенчатая регулировка».]]></description>
		<lastBuildDate>Thu, 03 Feb 2022 14:54:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Ступенчатая регулировка]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=5373#p5373</link>
			<description><![CDATA[<p>Все, всем спасибо. Сам сообразил. Тема закрыта.</p>]]></description>
			<author><![CDATA[null@example.com (pafnutiy)]]></author>
			<pubDate>Thu, 03 Feb 2022 14:54:50 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=5373#p5373</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ступенчатая регулировка]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=5372#p5372</link>
			<description><![CDATA[<p>if (millis() - time4 &gt; 1000) {<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;i_ch = i_reg / 8;&nbsp; analogWrite(pwm, (i_reg * 255 / 2));&nbsp; &nbsp; &nbsp; //i_reg регулировочный ток,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( далее уходит в шим), делю на 8&nbsp; ступеней ( i_ch),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; от 0 до&nbsp; 8 ступени++, с 8&nbsp; ступени -- обратно в 0.</p><p>&nbsp; &nbsp; &nbsp; i_reg1 += i_ch;// i_ch </p><p>&nbsp; &nbsp; &nbsp; if (i_reg1 &lt;= 0 || i_reg1 &gt;= i_reg) { i_ch = -i_ch; }&nbsp; &nbsp; &nbsp; //когда i_reg1 (это 8*i_ch) он = i_reg (т.к. это один ток) должен <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; переключиться с&nbsp; с + i_ch на&nbsp; -i_ch и уйти в 0. Но он этого не <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;делает<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; time4 = millis();}</p>]]></description>
			<author><![CDATA[null@example.com (pafnutiy)]]></author>
			<pubDate>Thu, 03 Feb 2022 13:45:09 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=5372#p5372</guid>
		</item>
		<item>
			<title><![CDATA[Re: Ступенчатая регулировка]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=5371#p5371</link>
			<description><![CDATA[<div class="codebox"><pre><code>unsigned long times;
int i;

void setup() {
 pinMode(9,OUTPUT); 
}

void loop() {
 if(millis()-times&gt;1000){
  i++;
  if(i&gt;255){i=0;}
  analogWrite(9,i);
  times=millis();
  }

}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Thu, 03 Feb 2022 12:55:38 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=5371#p5371</guid>
		</item>
		<item>
			<title><![CDATA[Ступенчатая регулировка]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=5369#p5369</link>
			<description><![CDATA[<p>Помогите пожалуйста. Я только учусь. Надо, чтобы в этом цикле (за эту секунду) проскакивала только&nbsp; одна &quot;i&quot;.<br />&nbsp; &nbsp;&quot;i&quot; -это переменное значение в этой программе, так же как и i_reg.</p><p>&nbsp; if(millis()-time4&gt;1000){</p><p>&nbsp; for (float i=0; i&lt;=i_reg; i=i+i_ch){analogWrite(pwm,i*255/2);}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;for (float i=i_reg; i&gt;=0; i=i-i_ch){analogWrite(pwm,i*255/2);} </p><p>&nbsp; &nbsp;time4=millis();}</p><p>Был еще такой первоначальный вариант: Но в нем&nbsp; i_reg1 запросто перескакивает i_reg и уходит в 255.</p><p>if (millis() - time4 &gt; 1000) {<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;i_ch = i_reg / 8;&nbsp; analogWrite(pwm, (i_reg * 255 / 2)); </p><p>&nbsp; &nbsp; &nbsp; i_reg1 += i_ch;</p><p>&nbsp; &nbsp; &nbsp; if (i_reg1 &lt;= 0 || i_reg1 &gt;= i_reg) { i_ch = -i_ch; }<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; time4 = millis();}<br />Не пойму, что не так.</p>]]></description>
			<author><![CDATA[null@example.com (pafnutiy)]]></author>
			<pubDate>Thu, 03 Feb 2022 12:48:50 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=5369#p5369</guid>
		</item>
	</channel>
</rss>
