<?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; PCF8574 - расширитель портов]]></title>
		<link>http://forum.rcl-radio.ru/viewtopic.php?id=138</link>
		<atom:link href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=138&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «PCF8574 - расширитель портов».]]></description>
		<lastBuildDate>Wed, 11 Mar 2020 13:41:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: PCF8574 - расширитель портов]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=1121#p1121</link>
			<description><![CDATA[<p>Библиотека:</p><p><span class="attention-yellow"></span>&nbsp; <br /> В качестве модуля подключения кнопок использовался модуль PCF8574&nbsp; I2C управления LCD 1602,вывод подсветки(Р3) не использован. Кнопки подключены к минусу питания( GND).</p><div class="codebox"><pre><code>#include &lt;Wire.h&gt;    
#include &quot;PCF8574.h&quot; 
PCF8574 expander;
void setup()
{
  Serial.begin(115200);
  expander.begin(0x3A);
    
  expander.pinMode(0,INPUT_PULLUP);
  expander.pinMode(1,INPUT_PULLUP);
  expander.pinMode(2,INPUT_PULLUP);
  expander.pinMode(4,INPUT_PULLUP);
  expander.pinMode(5,INPUT_PULLUP);
  expander.pinMode(6,INPUT_PULLUP);
  expander.pinMode(7,INPUT_PULLUP);
}
void loop() {

  delay(100);                
  Serial.print(&quot; 0 &quot;);
  Serial.print(expander.digitalRead(0) ? &quot;HIGH&quot; : &quot;LOW&quot;); 
 
  delay(10);                
  Serial.print(&quot; 1 &quot;);
  Serial.print(expander.digitalRead(1) ? &quot;HIGH&quot; : &quot;LOW&quot;);
 
  delay(10);                 
  Serial.print(&quot; 2 &quot;);
  Serial.print(expander.digitalRead(2) ? &quot;HIGH&quot; : &quot;LOW&quot;); 
 
  delay(10);                 
  Serial.print(&quot; 4 &quot;);
  Serial.print(expander.digitalRead(4) ? &quot;HIGH&quot; : &quot;LOW&quot;); 
 
  delay(10);                
  Serial.print(&quot; 5 &quot;);
  Serial.print(expander.digitalRead(5) ? &quot;HIGH&quot; : &quot;LOW&quot;);
  delay(10);
                  
  Serial.print(&quot; 6 &quot;);
  Serial.print(expander.digitalRead(6) ? &quot;HIGH&quot; : &quot;LOW&quot;); 

  delay(10);                 
  Serial.print(&quot; 7 &quot;);
  Serial.print(expander.digitalRead(7) ? &quot;HIGH&quot; : &quot;LOW&quot;);
   
  Serial.println(); 
  delay(1000);
}</code></pre></div><p>Скетч выводит состояние кнопок в Сериал порт</p>]]></description>
			<author><![CDATA[null@example.com (derdemons)]]></author>
			<pubDate>Wed, 11 Mar 2020 13:41:05 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=1121#p1121</guid>
		</item>
		<item>
			<title><![CDATA[PCF8574 - расширитель портов]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=1094#p1094</link>
			<description><![CDATA[<p><span class="postimg"><img src="http://forum.rcl-radio.ru/uploads/images/2020/03/f73f5fb422fd9218c0b3d1f365695f7d.png" alt="http://forum.rcl-radio.ru/uploads/images/2020/03/f73f5fb422fd9218c0b3d1f365695f7d.png" /></span> </p><br /><div class="codebox"><pre><code>#include &lt;Wire.h&gt;
#include &lt;PCF8574.h&gt; // https://github.com/xreef/PCF8574_library.git
  PCF8574 pcf(0x27); 

void setup() {
 pcf.pinMode(P0, INPUT); // P0...P7
 pcf.pinMode(P1, INPUT); // P0...P7
 pinMode(13,OUTPUT);
}

void loop() {
  if(pcf.digitalRead(P0)==LOW){digitalWrite(13,HIGH);}
  if(pcf.digitalRead(P1)==LOW){digitalWrite(13,LOW);}
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Thu, 05 Mar 2020 13:39:40 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=1094#p1094</guid>
		</item>
	</channel>
</rss>
