<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Smart Home Automation Forum - F32]]></title>
		<link>https://www.kincony.com/forum/</link>
		<description><![CDATA[Smart Home Automation Forum - https://www.kincony.com/forum]]></description>
		<pubDate>Sun, 05 Apr 2026 15:16:36 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[F32 and 433 Mhz]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8942</link>
			<pubDate>Thu, 15 Jan 2026 08:21:12 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=4217">lulu01</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8942</guid>
			<description><![CDATA[Hello,<br />
<br />
on the F32, if I want to use a Kincony 433 Mhz remote:<br />
<br />
- can I do this with ESPHome instead of KCS?<br />
- do I need to buy a RF433 MHz tx/rx module, or is it included in the board already?<br />
- with the ESPHome firmware, how do I learn the codes from the remote controller and associate them to relays?<br />
<br />
Thank you!]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
on the F32, if I want to use a Kincony 433 Mhz remote:<br />
<br />
- can I do this with ESPHome instead of KCS?<br />
- do I need to buy a RF433 MHz tx/rx module, or is it included in the board already?<br />
- with the ESPHome firmware, how do I learn the codes from the remote controller and associate them to relays?<br />
<br />
Thank you!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-11 digital INPUT trigger OUTPUT directly]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8708</link>
			<pubDate>Tue, 04 Nov 2025 07:33:42 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8708</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This program reads 32 input states from three PCF8575 I/O expanders and <br />
 * controls a corresponding 32-channel relay module. <br />
 * When an input pin is LOW, the corresponding relay is turned ON (LOW means ON for the relay).<br />
 * When the input pin is HIGH, the corresponding relay is turned OFF.<br />
 *<br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
<br />
PCF8575:U27 (relay17-32) i2c address:0x25<br />
PCF8575:U23 (DI1-16) i2c address:0x24<br />
PCF8575:U49 i2c address: 0x26<br />
  PCF8575(pin number0-7):DI17-24<br />
  PCF8575(pin number8-11):relay13-16<br />
  PCF8575(pin number12-15):relay9-12<br />
<br />
PCF8575:U62 i2c address: 0x27<br />
  PCF8575(pin number0-7):DI25-32<br />
  PCF8575(pin number8-15):relay1-8<br />
 */<br />
<br />
#include &lt;Wire.h&gt;        // I2C communication<br />
#include &lt;PCF8575.h&gt;   &nbsp;&nbsp;// Library to control the PCF8575 I/O expander<br />
<br />
// Define I2C pins<br />
#define SDA 8            // SDA pin<br />
#define SCL 18         &nbsp;&nbsp;// SCL pin<br />
<br />
// I2C addresses for the PCF8575 modules<br />
#define INPUT_I2C_ADDRESS_1 0x24 &nbsp;&nbsp;<br />
#define INPUT_RELAY_I2C_ADDRESS_2 0x26  <br />
#define RELAY_I2C_ADDRESS_3 0x25  <br />
#define INPUT_RELAY_I2C_ADDRESS_3 0x27 &nbsp;&nbsp;<br />
<br />
PCF8575 pcf8575_IN1(INPUT_I2C_ADDRESS_1);    <br />
PCF8575 pcf8575_IN2(INPUT_RELAY_I2C_ADDRESS_2);    <br />
PCF8575 pcf8575_RL(RELAY_I2C_ADDRESS_3); &nbsp;&nbsp;<br />
PCF8575 pcf8575_IN3(INPUT_RELAY_I2C_ADDRESS_3); <br />
<br />
void setup() {<br />
  // Initialize I2C communication<br />
  Wire.begin(SDA, SCL);<br />
  <br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  <br />
  // Initialize input and relay modules<br />
  pcf8575_IN1.begin();  <br />
  pcf8575_IN2.begin();  <br />
  pcf8575_IN3.begin(); <br />
  pcf8575_RL.begin();  <br />
  <br />
  // Turn off all relays at the start (LOW means OFF)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_IN2.write(i, HIGH); <br />
  }<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_RL.write(i, HIGH); <br />
  }<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_IN3.write(i, HIGH);  <br />
  }<br />
  Serial.println("System started: Input state controlling 24 relays");<br />
}<br />
<br />
void loop() {<br />
    bool inputState;<br />
    inputState = pcf8575_IN1.read(0);  // input1 control relay1<br />
    if (inputState) {<br />
      pcf8575_IN3.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(8, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
  <br />
    inputState = pcf8575_IN1.read(1);  // input2 control relay2<br />
    if (inputState) {<br />
      pcf8575_IN3.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(9, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(2);  // input3 control relay3<br />
    if (inputState) {<br />
      pcf8575_IN3.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(10, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(3);  // input4 control relay4<br />
    if (inputState) {<br />
      pcf8575_IN3.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(11, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(4);  // input5 control relay5<br />
    if (inputState) {<br />
      pcf8575_IN3.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(12, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(5);  // input6 control relay6<br />
    if (inputState) {<br />
      pcf8575_IN3.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(13, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(6);  // input7 control relay7<br />
    if (inputState) {<br />
      pcf8575_IN3.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(14, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(7);  // input8 control relay8<br />
    if (inputState) {<br />
      pcf8575_IN3.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(15, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(8);  // input9 control relay9<br />
    if (inputState) {<br />
      pcf8575_IN2.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(12, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(9);  // input10 control relay10<br />
    if (inputState) {<br />
      pcf8575_IN2.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(13, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(10);  // input11 control relay11<br />
    if (inputState) {<br />
      pcf8575_IN2.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(14, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(11);  // input12 control relay12<br />
    if (inputState) {<br />
      pcf8575_IN2.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(15, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(12);  // input13 control relay13<br />
    if (inputState) {<br />
      pcf8575_IN2.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(8, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(13);  // input14 control relay14<br />
    if (inputState) {<br />
      pcf8575_IN2.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(9, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(14);  // input15 control relay15<br />
    if (inputState) {<br />
      pcf8575_IN2.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(10, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(15);  // input16 control relay16<br />
    if (inputState) {<br />
      pcf8575_IN2.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(11, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(0);  // input17 control relay17<br />
    if (inputState) {<br />
      pcf8575_RL.write(0, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(0, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(1);  // input18 control relay18<br />
    if (inputState) {<br />
      pcf8575_RL.write(1, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(1, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(2);  // input19 control relay19<br />
    if (inputState) {<br />
      pcf8575_RL.write(2, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(2, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(3);  // input20 control relay20<br />
    if (inputState) {<br />
      pcf8575_RL.write(3, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(3, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(4);  // input21 control relay21<br />
    if (inputState) {<br />
      pcf8575_RL.write(4, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(4, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(5);  // input22 control relay22<br />
    if (inputState) {<br />
      pcf8575_RL.write(5, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(5, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(6);  // input23 control relay23<br />
    if (inputState) {<br />
      pcf8575_RL.write(6, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(6, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(7);  // input24 control relay24<br />
    if (inputState) {<br />
      pcf8575_RL.write(7, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(7, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(0);  // input25 control relay25<br />
    if (inputState) {<br />
      pcf8575_RL.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(8, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(1);  // input26 control relay26<br />
    if (inputState) {<br />
      pcf8575_RL.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(9, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(2);  // input27 control relay27<br />
    if (inputState) {<br />
      pcf8575_RL.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(10, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(3);  // input28 control relay28<br />
    if (inputState) {<br />
      pcf8575_RL.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(11, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(4);  // input29 control relay29<br />
    if (inputState) {<br />
      pcf8575_RL.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(12, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(5);  // input30 control relay30<br />
    if (inputState) {<br />
      pcf8575_RL.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(13, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(6);  // input31 control relay31<br />
    if (inputState) {<br />
      pcf8575_RL.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(14, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(7);  // input32 control relay32<br />
    if (inputState) {<br />
      pcf8575_RL.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(15, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
  // Delay for 500 milliseconds<br />
  delay(500);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8578" target="_blank" title="">11-input-trigger-output.zip</a> (Size: 1.54 KB / Downloads: 175)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8579" target="_blank" title="">11-input-trigger-output.ino.merged.zip</a> (Size: 198.09 KB / Downloads: 184)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This program reads 32 input states from three PCF8575 I/O expanders and <br />
 * controls a corresponding 32-channel relay module. <br />
 * When an input pin is LOW, the corresponding relay is turned ON (LOW means ON for the relay).<br />
 * When the input pin is HIGH, the corresponding relay is turned OFF.<br />
 *<br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
<br />
PCF8575:U27 (relay17-32) i2c address:0x25<br />
PCF8575:U23 (DI1-16) i2c address:0x24<br />
PCF8575:U49 i2c address: 0x26<br />
  PCF8575(pin number0-7):DI17-24<br />
  PCF8575(pin number8-11):relay13-16<br />
  PCF8575(pin number12-15):relay9-12<br />
<br />
PCF8575:U62 i2c address: 0x27<br />
  PCF8575(pin number0-7):DI25-32<br />
  PCF8575(pin number8-15):relay1-8<br />
 */<br />
<br />
#include &lt;Wire.h&gt;        // I2C communication<br />
#include &lt;PCF8575.h&gt;   &nbsp;&nbsp;// Library to control the PCF8575 I/O expander<br />
<br />
// Define I2C pins<br />
#define SDA 8            // SDA pin<br />
#define SCL 18         &nbsp;&nbsp;// SCL pin<br />
<br />
// I2C addresses for the PCF8575 modules<br />
#define INPUT_I2C_ADDRESS_1 0x24 &nbsp;&nbsp;<br />
#define INPUT_RELAY_I2C_ADDRESS_2 0x26  <br />
#define RELAY_I2C_ADDRESS_3 0x25  <br />
#define INPUT_RELAY_I2C_ADDRESS_3 0x27 &nbsp;&nbsp;<br />
<br />
PCF8575 pcf8575_IN1(INPUT_I2C_ADDRESS_1);    <br />
PCF8575 pcf8575_IN2(INPUT_RELAY_I2C_ADDRESS_2);    <br />
PCF8575 pcf8575_RL(RELAY_I2C_ADDRESS_3); &nbsp;&nbsp;<br />
PCF8575 pcf8575_IN3(INPUT_RELAY_I2C_ADDRESS_3); <br />
<br />
void setup() {<br />
  // Initialize I2C communication<br />
  Wire.begin(SDA, SCL);<br />
  <br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  <br />
  // Initialize input and relay modules<br />
  pcf8575_IN1.begin();  <br />
  pcf8575_IN2.begin();  <br />
  pcf8575_IN3.begin(); <br />
  pcf8575_RL.begin();  <br />
  <br />
  // Turn off all relays at the start (LOW means OFF)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_IN2.write(i, HIGH); <br />
  }<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_RL.write(i, HIGH); <br />
  }<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_IN3.write(i, HIGH);  <br />
  }<br />
  Serial.println("System started: Input state controlling 24 relays");<br />
}<br />
<br />
void loop() {<br />
    bool inputState;<br />
    inputState = pcf8575_IN1.read(0);  // input1 control relay1<br />
    if (inputState) {<br />
      pcf8575_IN3.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(8, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
  <br />
    inputState = pcf8575_IN1.read(1);  // input2 control relay2<br />
    if (inputState) {<br />
      pcf8575_IN3.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(9, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(2);  // input3 control relay3<br />
    if (inputState) {<br />
      pcf8575_IN3.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(10, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(3);  // input4 control relay4<br />
    if (inputState) {<br />
      pcf8575_IN3.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(11, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(4);  // input5 control relay5<br />
    if (inputState) {<br />
      pcf8575_IN3.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(12, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(5);  // input6 control relay6<br />
    if (inputState) {<br />
      pcf8575_IN3.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(13, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(6);  // input7 control relay7<br />
    if (inputState) {<br />
      pcf8575_IN3.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(14, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(7);  // input8 control relay8<br />
    if (inputState) {<br />
      pcf8575_IN3.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN3.write(15, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(8);  // input9 control relay9<br />
    if (inputState) {<br />
      pcf8575_IN2.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(12, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(9);  // input10 control relay10<br />
    if (inputState) {<br />
      pcf8575_IN2.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(13, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(10);  // input11 control relay11<br />
    if (inputState) {<br />
      pcf8575_IN2.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(14, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(11);  // input12 control relay12<br />
    if (inputState) {<br />
      pcf8575_IN2.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(15, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(12);  // input13 control relay13<br />
    if (inputState) {<br />
      pcf8575_IN2.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(8, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(13);  // input14 control relay14<br />
    if (inputState) {<br />
      pcf8575_IN2.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(9, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(14);  // input15 control relay15<br />
    if (inputState) {<br />
      pcf8575_IN2.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(10, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN1.read(15);  // input16 control relay16<br />
    if (inputState) {<br />
      pcf8575_IN2.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_IN2.write(11, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(0);  // input17 control relay17<br />
    if (inputState) {<br />
      pcf8575_RL.write(0, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(0, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(1);  // input18 control relay18<br />
    if (inputState) {<br />
      pcf8575_RL.write(1, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(1, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(2);  // input19 control relay19<br />
    if (inputState) {<br />
      pcf8575_RL.write(2, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(2, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(3);  // input20 control relay20<br />
    if (inputState) {<br />
      pcf8575_RL.write(3, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(3, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(4);  // input21 control relay21<br />
    if (inputState) {<br />
      pcf8575_RL.write(4, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(4, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(5);  // input22 control relay22<br />
    if (inputState) {<br />
      pcf8575_RL.write(5, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(5, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(6);  // input23 control relay23<br />
    if (inputState) {<br />
      pcf8575_RL.write(6, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(6, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN2.read(7);  // input24 control relay24<br />
    if (inputState) {<br />
      pcf8575_RL.write(7, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(7, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(0);  // input25 control relay25<br />
    if (inputState) {<br />
      pcf8575_RL.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(8, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(1);  // input26 control relay26<br />
    if (inputState) {<br />
      pcf8575_RL.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(9, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(2);  // input27 control relay27<br />
    if (inputState) {<br />
      pcf8575_RL.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(10, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(3);  // input28 control relay28<br />
    if (inputState) {<br />
      pcf8575_RL.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(11, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(4);  // input29 control relay29<br />
    if (inputState) {<br />
      pcf8575_RL.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(12, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(5);  // input30 control relay30<br />
    if (inputState) {<br />
      pcf8575_RL.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(13, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(6);  // input31 control relay31<br />
    if (inputState) {<br />
      pcf8575_RL.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(14, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
    inputState = pcf8575_IN3.read(7);  // input32 control relay32<br />
    if (inputState) {<br />
      pcf8575_RL.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF<br />
    } else {<br />
      pcf8575_RL.write(15, LOW); &nbsp;&nbsp;// If input is LOW, turn the corresponding relay ON<br />
    }<br />
<br />
  // Delay for 500 milliseconds<br />
  delay(500);<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8578" target="_blank" title="">11-input-trigger-output.zip</a> (Size: 1.54 KB / Downloads: 175)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8579" target="_blank" title="">11-input-trigger-output.ino.merged.zip</a> (Size: 198.09 KB / Downloads: 184)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-02 Read digital input ports state]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8699</link>
			<pubDate>Tue, 04 Nov 2025 07:27:08 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8699</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 *<br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * - PCF8575 I2C Address: 0x24 for inputs 1-16, 0x26 for inputs 17-24, 0x27 for inputs 18-25<br />
 */<br />
<br />
#include "Arduino.h"<br />
#include "PCF8575.h"<br />
<br />
// Define I2C pins<br />
#define I2C_SDA 8  // Define SDA pin<br />
#define I2C_SCL 18  // Define SCL pin<br />
<br />
// Set I2C addresses<br />
PCF8575 pcf8575_IN1(0x24); // The I2C address of the first PCF8575 (inputs 1-16)<br />
PCF8575 pcf8575_IN2(0x26); // The I2C address of the second PCF8575 (inputs 17-24)<br />
PCF8575 pcf8575_IN3(0x27); // The I2C address of the second PCF8575 (inputs 25-32)<br />
<br />
void setup() {<br />
    Serial.begin(115200);<br />
<br />
    // Initialize I2C communication<br />
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins<br />
<br />
    // Initialize both PCF8575 modules<br />
    pcf8575_IN1.begin();<br />
    pcf8575_IN2.begin();<br />
    pcf8575_IN3.begin();<br />
<br />
    Serial.println("KinCony F32 32 channel input state 0:ON  1:OFF");<br />
}<br />
<br />
void loop() {<br />
    uint32_t state = 0; // Use a 32-bit variable to store the state of all 24 pins<br />
<br />
    // Read the state of each pin from the first PCF8575 (inputs 1-16)<br />
    for (int pin = 0; pin &lt; 16; pin++) {<br />
        if (pcf8575_IN1.read(pin)) {<br />
            state |= (1UL &lt;&lt; pin); // Set the bit for the active pin (inputs 1-16)<br />
        }<br />
    }<br />
<br />
    // Read the state of each pin from the second PCF8575 (inputs 17-24, corresponding to pins 0-7)<br />
    for (int pin = 0; pin &lt; 8; pin++) {<br />
        if (pcf8575_IN2.read(pin)) {<br />
            state |= (1UL &lt;&lt; (pin + 16)); // Set the bit for the active pin (inputs 17-24)<br />
        }<br />
    }<br />
<br />
    // Read the state of each pin from the second PCF8575 (inputs 25-32, corresponding to pins 0-7)<br />
    for (int pin = 0; pin &lt; 8; pin++) {<br />
        if (pcf8575_IN3.read(pin)) {<br />
            state |= (1UL &lt;&lt; (pin + 24));<br />
        }<br />
    }<br />
<br />
    // Print the state of all 24 inputs in binary format<br />
    Serial.print("Input state: ");<br />
    Serial.println(state, BIN); // Print the state of inputs in binary<br />
<br />
    delay(500); // Delay 500ms<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8568" target="_blank" title="">2-digital-input.zip</a> (Size: 885 bytes / Downloads: 171)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8569" target="_blank" title="">2-digital-input.ino.merged.zip</a> (Size: 197.91 KB / Downloads: 180)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 *<br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * - PCF8575 I2C Address: 0x24 for inputs 1-16, 0x26 for inputs 17-24, 0x27 for inputs 18-25<br />
 */<br />
<br />
#include "Arduino.h"<br />
#include "PCF8575.h"<br />
<br />
// Define I2C pins<br />
#define I2C_SDA 8  // Define SDA pin<br />
#define I2C_SCL 18  // Define SCL pin<br />
<br />
// Set I2C addresses<br />
PCF8575 pcf8575_IN1(0x24); // The I2C address of the first PCF8575 (inputs 1-16)<br />
PCF8575 pcf8575_IN2(0x26); // The I2C address of the second PCF8575 (inputs 17-24)<br />
PCF8575 pcf8575_IN3(0x27); // The I2C address of the second PCF8575 (inputs 25-32)<br />
<br />
void setup() {<br />
    Serial.begin(115200);<br />
<br />
    // Initialize I2C communication<br />
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins<br />
<br />
    // Initialize both PCF8575 modules<br />
    pcf8575_IN1.begin();<br />
    pcf8575_IN2.begin();<br />
    pcf8575_IN3.begin();<br />
<br />
    Serial.println("KinCony F32 32 channel input state 0:ON  1:OFF");<br />
}<br />
<br />
void loop() {<br />
    uint32_t state = 0; // Use a 32-bit variable to store the state of all 24 pins<br />
<br />
    // Read the state of each pin from the first PCF8575 (inputs 1-16)<br />
    for (int pin = 0; pin &lt; 16; pin++) {<br />
        if (pcf8575_IN1.read(pin)) {<br />
            state |= (1UL &lt;&lt; pin); // Set the bit for the active pin (inputs 1-16)<br />
        }<br />
    }<br />
<br />
    // Read the state of each pin from the second PCF8575 (inputs 17-24, corresponding to pins 0-7)<br />
    for (int pin = 0; pin &lt; 8; pin++) {<br />
        if (pcf8575_IN2.read(pin)) {<br />
            state |= (1UL &lt;&lt; (pin + 16)); // Set the bit for the active pin (inputs 17-24)<br />
        }<br />
    }<br />
<br />
    // Read the state of each pin from the second PCF8575 (inputs 25-32, corresponding to pins 0-7)<br />
    for (int pin = 0; pin &lt; 8; pin++) {<br />
        if (pcf8575_IN3.read(pin)) {<br />
            state |= (1UL &lt;&lt; (pin + 24));<br />
        }<br />
    }<br />
<br />
    // Print the state of all 24 inputs in binary format<br />
    Serial.print("Input state: ");<br />
    Serial.println(state, BIN); // Print the state of inputs in binary<br />
<br />
    delay(500); // Delay 500ms<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8568" target="_blank" title="">2-digital-input.zip</a> (Size: 885 bytes / Downloads: 171)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8569" target="_blank" title="">2-digital-input.ino.merged.zip</a> (Size: 197.91 KB / Downloads: 180)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-01 Turn ON/OFF relay]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8698</link>
			<pubDate>Tue, 04 Nov 2025 07:25:24 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8698</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This program controls a 32-channel relay board via two PCF8575 I/O expanders.<br />
 * It sequentially turns on each relay and then turns them off in a loop.<br />
 * <br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * <br />
 * Delay Time:<br />
 * - 200 milliseconds between switching relays<br />
 */<br />
<br />
#include &lt;Wire.h&gt;        // Include the Wire library for I2C communication<br />
#include &lt;PCF8575.h&gt;   &nbsp;&nbsp;// Include the PCF8575 library to control the I/O expander<br />
<br />
#define SDA 8            // Define the SDA pin<br />
#define SCL 18         &nbsp;&nbsp;// Define the SCL pin<br />
#define DELAY_TIME 200 &nbsp;&nbsp;// Define the delay time in milliseconds<br />
<br />
// Set I2C addresses of the PCF8575 modules<br />
#define I2C_ADDRESS_R1 0x25 // I2C address of the first PCF8575 module<br />
#define I2C_ADDRESS_R2 0x26 // I2C address of the second PCF8575 module<br />
#define I2C_ADDRESS_R3 0x27 // I2C address of the second PCF8575 module<br />
<br />
PCF8575 pcf8575_R1(I2C_ADDRESS_R1); // Create a PCF8575 object for the first module (for relays 17-32)<br />
PCF8575 pcf8575_R2(I2C_ADDRESS_R2); // Create a PCF8575 object for the second module (for relays 9-16)<br />
PCF8575 pcf8575_R3(I2C_ADDRESS_R3); // Create a PCF8575 object for the second module (for relays 1-8)<br />
<br />
void setup() {<br />
  // Initialize I2C communication<br />
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)<br />
  <br />
  // Initialize serial communication for debugging (optional)<br />
  Serial.begin(115200);<br />
  Serial.println("PCF8575 Relay Control: Starting...");<br />
<br />
  // Initialize the PCF8575 modules<br />
  pcf8575_R1.begin();<br />
  pcf8575_R2.begin();<br />
  pcf8575_R3.begin();<br />
<br />
  // Turn off all relays initially (set all pins HIGH)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_R1.write(i, HIGH); // Set relays 17-32 to OFF (assuming HIGH means OFF for relays)<br />
    pcf8575_R2.write(i, HIGH); // Set relays 9-16 to OFF (assuming HIGH means OFF for relays)<br />
  }<br />
<br />
  // Turn off all relays initially (set all pins HIGH)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R3.write(i, HIGH); // Set relays 1-8 to OFF (assuming HIGH means OFF for relays)<br />
  }<br />
<br />
}<br />
<br />
void loop() {<br />
  // Sequentially turn on each relay (1-32)<br />
<br />
  // First control the relays on the second PCF8575 (relays 1-8, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R3.write(i, LOW); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // First control the relays on the second PCF8575 (relays 9-16, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R2.write(i, LOW); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first PCF8575 (relays 17-32)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_R1.write(i, LOW); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Sequentially turn off each relay (1-24)<br />
  <br />
  // First control the relays on the second PCF8575 (relays 1-8, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R3.write(i, HIGH); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // First control the relays on the second PCF8575 (relays 9-16, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R2.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first PCF8575 (relays 17-32)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_R1.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8566" target="_blank" title="">1-relay.zip</a> (Size: 1.08 KB / Downloads: 167)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8567" target="_blank" title="">1-relay.ino.merged.zip</a> (Size: 197.73 KB / Downloads: 168)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This program controls a 32-channel relay board via two PCF8575 I/O expanders.<br />
 * It sequentially turns on each relay and then turns them off in a loop.<br />
 * <br />
 * Pin Definitions:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 * <br />
 * Delay Time:<br />
 * - 200 milliseconds between switching relays<br />
 */<br />
<br />
#include &lt;Wire.h&gt;        // Include the Wire library for I2C communication<br />
#include &lt;PCF8575.h&gt;   &nbsp;&nbsp;// Include the PCF8575 library to control the I/O expander<br />
<br />
#define SDA 8            // Define the SDA pin<br />
#define SCL 18         &nbsp;&nbsp;// Define the SCL pin<br />
#define DELAY_TIME 200 &nbsp;&nbsp;// Define the delay time in milliseconds<br />
<br />
// Set I2C addresses of the PCF8575 modules<br />
#define I2C_ADDRESS_R1 0x25 // I2C address of the first PCF8575 module<br />
#define I2C_ADDRESS_R2 0x26 // I2C address of the second PCF8575 module<br />
#define I2C_ADDRESS_R3 0x27 // I2C address of the second PCF8575 module<br />
<br />
PCF8575 pcf8575_R1(I2C_ADDRESS_R1); // Create a PCF8575 object for the first module (for relays 17-32)<br />
PCF8575 pcf8575_R2(I2C_ADDRESS_R2); // Create a PCF8575 object for the second module (for relays 9-16)<br />
PCF8575 pcf8575_R3(I2C_ADDRESS_R3); // Create a PCF8575 object for the second module (for relays 1-8)<br />
<br />
void setup() {<br />
  // Initialize I2C communication<br />
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)<br />
  <br />
  // Initialize serial communication for debugging (optional)<br />
  Serial.begin(115200);<br />
  Serial.println("PCF8575 Relay Control: Starting...");<br />
<br />
  // Initialize the PCF8575 modules<br />
  pcf8575_R1.begin();<br />
  pcf8575_R2.begin();<br />
  pcf8575_R3.begin();<br />
<br />
  // Turn off all relays initially (set all pins HIGH)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_R1.write(i, HIGH); // Set relays 17-32 to OFF (assuming HIGH means OFF for relays)<br />
    pcf8575_R2.write(i, HIGH); // Set relays 9-16 to OFF (assuming HIGH means OFF for relays)<br />
  }<br />
<br />
  // Turn off all relays initially (set all pins HIGH)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R3.write(i, HIGH); // Set relays 1-8 to OFF (assuming HIGH means OFF for relays)<br />
  }<br />
<br />
}<br />
<br />
void loop() {<br />
  // Sequentially turn on each relay (1-32)<br />
<br />
  // First control the relays on the second PCF8575 (relays 1-8, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R3.write(i, LOW); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // First control the relays on the second PCF8575 (relays 9-16, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R2.write(i, LOW); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first PCF8575 (relays 17-32)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_R1.write(i, LOW); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Sequentially turn off each relay (1-24)<br />
  <br />
  // First control the relays on the second PCF8575 (relays 1-8, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R3.write(i, HIGH); &nbsp;&nbsp;// Turn on the relay at pin i (LOW means ON for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // First control the relays on the second PCF8575 (relays 9-16, corresponding to pins 8-15)<br />
  for (int i = 8; i &lt; 16; i++) {<br />
    pcf8575_R2.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
<br />
  // Then control the relays on the first PCF8575 (relays 17-32)<br />
  for (int i = 0; i &lt; 16; i++) {<br />
    pcf8575_R1.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)<br />
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds<br />
  }<br />
}</code></div></div> arduino ino file download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8566" target="_blank" title="">1-relay.zip</a> (Size: 1.08 KB / Downloads: 167)
<!-- end: postbit_attachments_attachment --><br />
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8567" target="_blank" title="">1-relay.ino.merged.zip</a> (Size: 197.73 KB / Downloads: 168)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F32 ESPHome yaml for home assistant without tuya]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8697</link>
			<pubDate>Tue, 04 Nov 2025 07:22:41 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8697</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f32<br />
  friendly_name: f32<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
    <br />
<br />
# Enable logging<br />
<br />
logger:<br />
  level: DEBUG  <br />
  hardware_uart: USB_CDC<br />
# Enable Home Assistant API<br />
<br />
api:<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
<br />
i2c:<br />
 &nbsp;&nbsp;- id: bus_a<br />
   &nbsp;&nbsp;sda: 8<br />
   &nbsp;&nbsp;scl: 18<br />
   &nbsp;&nbsp;scan: true<br />
   &nbsp;&nbsp;frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 17-32<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_2'  # for output channel 9-16  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_3'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x27<br />
    pcf8575: true<br />
<br />
uart:<br />
  - id: uart_1    #RS485<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
<br />
switch:<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: gpio<br />
    name: "f32-output01"<br />
    id: "f32_output01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output02"<br />
    id: "f32_output02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output03"<br />
    id: "f32_output03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output04"<br />
    id: "f32_output04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output05"<br />
    id: "f32_output05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output06"<br />
    id: "f32_output06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output07"<br />
    id: "f32_output07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output08"<br />
    id: "f32_output08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output09"<br />
    id: "f32_output09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output10"<br />
    id: "f32_output10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output11"<br />
    id: "f32_output11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output12"<br />
    id: "f32_output12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output13"<br />
    id: "f32_output13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output14"<br />
    id: "f32_output14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output15"<br />
    id: "f32_output15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output16"<br />
    id: "f32_output16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output17"<br />
    id: "f32_output17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output18"<br />
    id: "f32_output18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output19"<br />
    id: "f32_output19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output20"<br />
    id: "f32_output20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output21"<br />
    id: "f32_output21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output22"<br />
    id: "f32_output22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output23"<br />
    id: "f32_output23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output24"<br />
    id: "f32_output24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output25"<br />
    id: "f32_output25"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output26"<br />
    id: "f32_output26"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output27"<br />
    id: "f32_output27"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output28"<br />
    id: "f32_output28"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output29"<br />
    id: "f32_output29"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output30"<br />
    id: "f32_output30"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output31"<br />
    id: "f32_output31"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output32"<br />
    id: "f32_output32"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f32-input01"<br />
    id: "f32_input01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input02"<br />
    id: "f32_input02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input03"<br />
    id: "f32_input03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input04"<br />
    id: "f32_input04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input05"<br />
    id: "f32_input05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input06"<br />
    id: "f32_input06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input07"<br />
    id: "f32_input07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input08"<br />
    id: "f32_input08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input09"<br />
    id: "f32_input09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input10"<br />
    id: "f32_input10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input11"<br />
    id: "f32_input11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input12"<br />
    id: "f32_input12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input13"<br />
    id: "f32_input13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input14"<br />
    id: "f32_input14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input15"<br />
    id: "f32_input15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input16"<br />
    id: "f32_input16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input17"<br />
    id: "f32_input17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input18"<br />
    id: "f32_input18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input19"<br />
    id: "f32_input19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input20"<br />
    id: "f32_input20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input21"<br />
    id: "f32_input21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input22"<br />
    id: "f32_input22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input23"<br />
    id: "f32_input23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input24"<br />
    id: "f32_input24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input25"<br />
    id: "f32_input25"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input26"<br />
    id: "f32_input26"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input27"<br />
    id: "f32_input27"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input28"<br />
    id: "f32_input28"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input29"<br />
    id: "f32_input29"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input30"<br />
    id: "f32_input30"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input31"<br />
    id: "f32_input31"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input32"<br />
    id: "f32_input32"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f32-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f32-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f32-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f32 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f32 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f32 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f32 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F32");</code></div></div>download yaml file:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8565" target="_blank" title="">F32-HA-without-tuya.txt</a> (Size: 14.25 KB / Downloads: 198)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: f32<br />
  friendly_name: f32<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
    <br />
<br />
# Enable logging<br />
<br />
logger:<br />
  level: DEBUG  <br />
  hardware_uart: USB_CDC<br />
# Enable Home Assistant API<br />
<br />
api:<br />
<br />
ethernet:<br />
  type: W5500<br />
  clk_pin: GPIO42<br />
  mosi_pin: GPIO43<br />
  miso_pin: GPIO44<br />
  cs_pin: GPIO41<br />
  interrupt_pin: GPIO2<br />
  reset_pin: GPIO1<br />
<br />
<br />
i2c:<br />
 &nbsp;&nbsp;- id: bus_a<br />
   &nbsp;&nbsp;sda: 8<br />
   &nbsp;&nbsp;scl: 18<br />
   &nbsp;&nbsp;scan: true<br />
   &nbsp;&nbsp;frequency: 400kHz<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 17-32<br />
    i2c_id: bus_a<br />
    address: 0x25<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for digital input channel 1-16<br />
    i2c_id: bus_a<br />
    address: 0x24<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_2'  # for output channel 9-16  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x26<br />
    pcf8575: true<br />
<br />
  - id: 'pcf8574_hub_out_in_3'  # for output channel 1-8  + (input 17-24)<br />
    i2c_id: bus_a<br />
    address: 0x27<br />
    pcf8575: true<br />
<br />
uart:<br />
  - id: uart_1    #RS485<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 16<br />
    rx_pin: 17<br />
<br />
switch:<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: gpio<br />
    name: "f32-output01"<br />
    id: "f32_output01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output02"<br />
    id: "f32_output02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output03"<br />
    id: "f32_output03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output04"<br />
    id: "f32_output04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output05"<br />
    id: "f32_output05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output06"<br />
    id: "f32_output06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output07"<br />
    id: "f32_output07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output08"<br />
    id: "f32_output08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output09"<br />
    id: "f32_output09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output10"<br />
    id: "f32_output10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output11"<br />
    id: "f32_output11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output12"<br />
    id: "f32_output12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output13"<br />
    id: "f32_output13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output14"<br />
    id: "f32_output14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output15"<br />
    id: "f32_output15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output16"<br />
    id: "f32_output16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output17"<br />
    id: "f32_output17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output18"<br />
    id: "f32_output18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output19"<br />
    id: "f32_output19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output20"<br />
    id: "f32_output20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output21"<br />
    id: "f32_output21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output22"<br />
    id: "f32_output22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output23"<br />
    id: "f32_output23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 6<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output24"<br />
    id: "f32_output24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 7<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output25"<br />
    id: "f32_output25"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 8<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output26"<br />
    id: "f32_output26"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 9<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output27"<br />
    id: "f32_output27"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 10<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output28"<br />
    id: "f32_output28"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 11<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output29"<br />
    id: "f32_output29"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 12<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output30"<br />
    id: "f32_output30"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 13<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output31"<br />
    id: "f32_output31"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 14<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-output32"<br />
    id: "f32_output32"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 15<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "f32-input01"<br />
    id: "f32_input01"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input02"<br />
    id: "f32_input02"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input03"<br />
    id: "f32_input03"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input04"<br />
    id: "f32_input04"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input05"<br />
    id: "f32_input05"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input06"<br />
    id: "f32_input06"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input07"<br />
    id: "f32_input07"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input08"<br />
    id: "f32_input08"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input09"<br />
    id: "f32_input09"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 8<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input10"<br />
    id: "f32_input10"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 9<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input11"<br />
    id: "f32_input11"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 10<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input12"<br />
    id: "f32_input12"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 11<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input13"<br />
    id: "f32_input13"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 12<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input14"<br />
    id: "f32_input14"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 13<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input15"<br />
    id: "f32_input15"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 14<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input16"<br />
    id: "f32_input16"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 15<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input17"<br />
    id: "f32_input17"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input18"<br />
    id: "f32_input18"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input19"<br />
    id: "f32_input19"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input20"<br />
    id: "f32_input20"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input21"<br />
    id: "f32_input21"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input22"<br />
    id: "f32_input22"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input23"<br />
    id: "f32_input23"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
  - platform: gpio<br />
    name: "f32-input24"<br />
    id: "f32_input24"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_2<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input25"<br />
    id: "f32_input25"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input26"<br />
    id: "f32_input26"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input27"<br />
    id: "f32_input27"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input28"<br />
    id: "f32_input28"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input29"<br />
    id: "f32_input29"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input30"<br />
    id: "f32_input30"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input31"<br />
    id: "f32_input31"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 6<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-input32"<br />
    id: "f32_input32"<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_in_3<br />
      number: 7<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "f32-W1-io48"<br />
    pin: <br />
      number: 48<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io47"<br />
    pin: <br />
      number: 47<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io21"<br />
    pin: <br />
      number: 21<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
## without resistance on PCB<br />
  - platform: gpio<br />
    name: "f32-W1-io13"<br />
    pin: <br />
      number: 13<br />
      inverted: false<br />
<br />
  - platform: gpio<br />
    name: "f32-W1-io14"<br />
    pin: <br />
      number: 14<br />
      inverted:  false<br />
<br />
  - platform: gpio<br />
    name: "f32-433M"<br />
    pin: <br />
      number: 40<br />
      inverted:  false<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 5<br />
    name: "f32 A1 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 7<br />
    name: "f32 A2 Voltage"<br />
    update_interval: 5s<br />
    attenuation: 11db<br />
    filters:<br />
      # - multiply: 1.51515<br />
      - lambda:<br />
          if (x &gt;= 3.11) {<br />
            return x * 1.60256;<br />
          } else if (x &lt;= 0.15) {<br />
            return 0;<br />
          } else {<br />
            return x * 1.51;<br />
          }<br />
  - platform: adc<br />
    pin: 6<br />
    name: "f32 A3 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
  - platform: adc<br />
    pin: 4<br />
    name: "f32 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<br />
<br />
web_server:<br />
  port: 80<br />
<br />
font:<br />
  - file: "gfonts://Roboto"<br />
    id: roboto<br />
    size: 20<br />
<br />
display:<br />
  - platform: ssd1306_i2c<br />
    i2c_id: bus_a<br />
    model: "SSD1306 128x64"<br />
    address: 0x3C<br />
    lambda: |-<br />
      it.printf(0, 0, id(roboto), "KinCony F32");</code></div></div>download yaml file:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8565" target="_blank" title="">F32-HA-without-tuya.txt</a> (Size: 14.25 KB / Downloads: 198)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[F32 ESP32-S3 IO pins define]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8696</link>
			<pubDate>Tue, 04 Nov 2025 07:21:02 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8696</guid>
			<description><![CDATA[ANALOG_A1(0-5v)    GPIO5<br />
ANALOG_A2(0-5v)    GPIO7<br />
ANALOG_A3(4-20mA)  GPIO6<br />
ANALOG_A4(4-20mA)  GPIO4<br />
<br />
IIC SDA:GPIO8<br />
IIC SCL:GPIO18<br />
<br />
PCF8575:U27 (relay17-32) i2c address:0x25<br />
PCF8575:U23 (DI1-16) i2c address:0x24<br />
PCF8575:U49 i2c address: 0x26<br />
  PCF8575(pin number0-7) : DI17-24<br />
  PCF8575(pin number8-11) : relay13-16<br />
  PCF8575(pin number12-15) : relay9-12<br />
<br />
PCF8575:U62 i2c address: 0x27<br />
  PCF8575(pin number0-7) : DI25-32<br />
  PCF8575(pin number8-15) :relay1-8<br />
<br />
<br />
if config by ESPHome:<br />
<br />
relay9: pcf8575(U49) number:12<br />
relay10: pcf8575(U49) number:13<br />
relay11: pcf8575(U49) number:14<br />
relay12: pcf8575(U49) number:15<br />
relay13: pcf8575(U49) number:8<br />
relay14: pcf8575(U49) number:9<br />
relay15: pcf8575(U49) number:10<br />
relay16: pcf8575(U49) number:11<br />
<br />
RF433MHz wireless receiver: GPIO40<br />
------------------------<br />
<br />
Ethernet (W5500) I/O define:<br />
<br />
clk_pin: GPIO42<br />
mosi_pin: GPIO43<br />
miso_pin: GPIO44<br />
cs_pin: GPIO41<br />
<br />
interrupt_pin: GPIO2<br />
reset_pin: GPIO1<br />
<br />
--------------------<br />
RS485: <br />
RXD:GPIO17<br />
TXD:GPIO16<br />
--------------------<br />
Tuya module:<br />
RXD:GPIO38<br />
TXD:GPIO39<br />
<br />
Tuya network button: Tuya module's P28<br />
Tuya network LED: Tuya module's P16<br />
<br />
---------------------<br />
1-wire (pull-up resistance on PCB): <br />
1-wire1:GPIO48<br />
1-wire2:GPIO47<br />
1-wire3:GPIO21<br />
1-wire4:GPIO15<br />
<br />
1-wire (without resistance on PCB): <br />
1-wire1:GPIO13<br />
1-wire2:GPIO14<br />
------------------------<br />
SD Card:<br />
SPI-MOSI:GPIO10<br />
SPI-SCK:GPIO11<br />
SPI-MISO:GPIO12<br />
SPI-CS:GPIO9<br />
------------------------<br />
24C02 EPROM i2c address: 0x50<br />
DS3231 RTC i2c address: 0x68<br />
SSD1306 display: i2c address:0x3c]]></description>
			<content:encoded><![CDATA[ANALOG_A1(0-5v)    GPIO5<br />
ANALOG_A2(0-5v)    GPIO7<br />
ANALOG_A3(4-20mA)  GPIO6<br />
ANALOG_A4(4-20mA)  GPIO4<br />
<br />
IIC SDA:GPIO8<br />
IIC SCL:GPIO18<br />
<br />
PCF8575:U27 (relay17-32) i2c address:0x25<br />
PCF8575:U23 (DI1-16) i2c address:0x24<br />
PCF8575:U49 i2c address: 0x26<br />
  PCF8575(pin number0-7) : DI17-24<br />
  PCF8575(pin number8-11) : relay13-16<br />
  PCF8575(pin number12-15) : relay9-12<br />
<br />
PCF8575:U62 i2c address: 0x27<br />
  PCF8575(pin number0-7) : DI25-32<br />
  PCF8575(pin number8-15) :relay1-8<br />
<br />
<br />
if config by ESPHome:<br />
<br />
relay9: pcf8575(U49) number:12<br />
relay10: pcf8575(U49) number:13<br />
relay11: pcf8575(U49) number:14<br />
relay12: pcf8575(U49) number:15<br />
relay13: pcf8575(U49) number:8<br />
relay14: pcf8575(U49) number:9<br />
relay15: pcf8575(U49) number:10<br />
relay16: pcf8575(U49) number:11<br />
<br />
RF433MHz wireless receiver: GPIO40<br />
------------------------<br />
<br />
Ethernet (W5500) I/O define:<br />
<br />
clk_pin: GPIO42<br />
mosi_pin: GPIO43<br />
miso_pin: GPIO44<br />
cs_pin: GPIO41<br />
<br />
interrupt_pin: GPIO2<br />
reset_pin: GPIO1<br />
<br />
--------------------<br />
RS485: <br />
RXD:GPIO17<br />
TXD:GPIO16<br />
--------------------<br />
Tuya module:<br />
RXD:GPIO38<br />
TXD:GPIO39<br />
<br />
Tuya network button: Tuya module's P28<br />
Tuya network LED: Tuya module's P16<br />
<br />
---------------------<br />
1-wire (pull-up resistance on PCB): <br />
1-wire1:GPIO48<br />
1-wire2:GPIO47<br />
1-wire3:GPIO21<br />
1-wire4:GPIO15<br />
<br />
1-wire (without resistance on PCB): <br />
1-wire1:GPIO13<br />
1-wire2:GPIO14<br />
------------------------<br />
SD Card:<br />
SPI-MOSI:GPIO10<br />
SPI-SCK:GPIO11<br />
SPI-MISO:GPIO12<br />
SPI-CS:GPIO9<br />
------------------------<br />
24C02 EPROM i2c address: 0x50<br />
DS3231 RTC i2c address: 0x68<br />
SSD1306 display: i2c address:0x3c]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-10 Print TEXT on SSD1306 OLED displayer]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8707</link>
			<pubDate>Thu, 28 Nov 2024 19:50:29 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8707</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 * <br />
 * This Arduino program demonstrates how to display text on an SSD1306 128x64 OLED display using the U8g2 library.<br />
 * The program draws two lines of text on the display:<br />
 * - The first line is "KINCONY" in a larger font.<br />
 * - The second line is "www.kincony.com" in a smaller font.<br />
 * <br />
 * The display is connected via I2C (software implementation) with:<br />
 * - SCL (clock) on pin IO18<br />
 * - SDA (data) on pin IO8<br />
 * <br />
 * The display's I2C address is set to 0x3C.<br />
 */<br />
<br />
#include &lt;U8g2lib.h&gt;  // Include the U8g2 library for controlling the OLED display<br />
#include &lt;Wire.h&gt;   &nbsp;&nbsp;// Include the Wire library for I2C communication<br />
<br />
// Initialize the display using the software I2C method (SCL = IO18, SDA = IO8)<br />
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  18, 8, U8X8_PIN_NONE);  // Screen rotation: U8G2_R0<br />
<br />
// Function to display page 1 content<br />
void page1() {<br />
  // Set font size 18 for the larger "KINCONY" text<br />
  u8g2.setFont(u8g2_font_timR18_tf);  // Use the Times Roman font, size 18<br />
  u8g2.setFontPosTop();             &nbsp;&nbsp;// Set the text position at the top of the display<br />
  u8g2.setCursor(5, 0);             &nbsp;&nbsp;// Position the cursor at coordinates (5, 0)<br />
  u8g2.print("KINCONY");              // Display the text "KINCONY" on the screen<br />
<br />
  // Set font size 12 for the smaller "www.kincony.com" text<br />
  u8g2.setFont(u8g2_font_timR12_tf);  // Use the Times Roman font, size 12<br />
  u8g2.setCursor(0, 40);              // Position the cursor at coordinates (0, 40)<br />
  u8g2.print("www.kincony.com");      // Display the text "www.kincony.com"<br />
}<br />
<br />
// Setup function, runs once when the program starts<br />
void setup() {<br />
  // Set the I2C address for the display to 0x3C<br />
  u8g2.setI2CAddress(0x3C*2);  // I2C address shift for 8-bit format<br />
  <br />
  // Initialize the display<br />
  u8g2.begin();<br />
  <br />
  // Enable UTF-8 character printing for the display<br />
  u8g2.enableUTF8Print();  // Allow UTF-8 encoded text to be printed<br />
}<br />
<br />
// Main loop function, continuously runs after setup()<br />
void loop() {<br />
  // Begin the display drawing process<br />
  u8g2.firstPage();  // Prepare the first page for drawing<br />
  do {<br />
    // Call the page1() function to draw content on the display<br />
    page1();<br />
  } while (u8g2.nextPage());  // Continue to the next page until all pages are drawn<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8577" target="_blank" title="">10-oled-ssd1306.zip</a> (Size: 1.11 KB / Downloads: 457)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 * <br />
 * This Arduino program demonstrates how to display text on an SSD1306 128x64 OLED display using the U8g2 library.<br />
 * The program draws two lines of text on the display:<br />
 * - The first line is "KINCONY" in a larger font.<br />
 * - The second line is "www.kincony.com" in a smaller font.<br />
 * <br />
 * The display is connected via I2C (software implementation) with:<br />
 * - SCL (clock) on pin IO18<br />
 * - SDA (data) on pin IO8<br />
 * <br />
 * The display's I2C address is set to 0x3C.<br />
 */<br />
<br />
#include &lt;U8g2lib.h&gt;  // Include the U8g2 library for controlling the OLED display<br />
#include &lt;Wire.h&gt;   &nbsp;&nbsp;// Include the Wire library for I2C communication<br />
<br />
// Initialize the display using the software I2C method (SCL = IO18, SDA = IO8)<br />
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  18, 8, U8X8_PIN_NONE);  // Screen rotation: U8G2_R0<br />
<br />
// Function to display page 1 content<br />
void page1() {<br />
  // Set font size 18 for the larger "KINCONY" text<br />
  u8g2.setFont(u8g2_font_timR18_tf);  // Use the Times Roman font, size 18<br />
  u8g2.setFontPosTop();             &nbsp;&nbsp;// Set the text position at the top of the display<br />
  u8g2.setCursor(5, 0);             &nbsp;&nbsp;// Position the cursor at coordinates (5, 0)<br />
  u8g2.print("KINCONY");              // Display the text "KINCONY" on the screen<br />
<br />
  // Set font size 12 for the smaller "www.kincony.com" text<br />
  u8g2.setFont(u8g2_font_timR12_tf);  // Use the Times Roman font, size 12<br />
  u8g2.setCursor(0, 40);              // Position the cursor at coordinates (0, 40)<br />
  u8g2.print("www.kincony.com");      // Display the text "www.kincony.com"<br />
}<br />
<br />
// Setup function, runs once when the program starts<br />
void setup() {<br />
  // Set the I2C address for the display to 0x3C<br />
  u8g2.setI2CAddress(0x3C*2);  // I2C address shift for 8-bit format<br />
  <br />
  // Initialize the display<br />
  u8g2.begin();<br />
  <br />
  // Enable UTF-8 character printing for the display<br />
  u8g2.enableUTF8Print();  // Allow UTF-8 encoded text to be printed<br />
}<br />
<br />
// Main loop function, continuously runs after setup()<br />
void loop() {<br />
  // Begin the display drawing process<br />
  u8g2.firstPage();  // Prepare the first page for drawing<br />
  do {<br />
    // Call the page1() function to draw content on the display<br />
    page1();<br />
  } while (u8g2.nextPage());  // Continue to the next page until all pages are drawn<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8577" target="_blank" title="">10-oled-ssd1306.zip</a> (Size: 1.11 KB / Downloads: 457)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-09 how to communication with Tuya WiFi module]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8706</link>
			<pubDate>Thu, 28 Nov 2024 19:49:35 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8706</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 * <br />
 * This Arduino program implements communication between ESP32 and the Tuya module<br />
 * via UART (serial communication). It listens for specific packets from the Tuya module<br />
 * and responds according to the predefined commands.<br />
 * <br />
 * Functionality:<br />
 * 1. When the ESP32 receives a heartbeat packet (55 AA 00 00 00 00 FF),<br />
 *    it sends a heartbeat response (55 AA 03 00 00 01 00 03).<br />
 * 2. When the ESP32 receives a product information request (55 AA 00 01 00 00 00),<br />
 *    it sends a product information response (55 AA 03 01 ...).<br />
 * 3. When the ESP32 receives a work mode request (55 AA 00 02 00 00 01),<br />
 *    it sends a work mode response (55 AA 03 02 00 03 10 1C 14 47).<br />
 * 4. When the ESP32 receives a network status request (55 AA 00 03 00 01 00 03),<br />
 *    it sends a network status response (55 AA 03 03 00 00 05).<br />
 * 5. Subsequent heartbeat packets (55 AA 00 00 00 00 FF) are responded to with<br />
 *    (55 AA 03 00 00 01 01 04).<br />
 */<br />
<br />
#include &lt;HardwareSerial.h&gt;<br />
<br />
// Create a HardwareSerial object for UART communication on ESP32<br />
HardwareSerial tuyaSerial(1);<br />
<br />
// Define the GPIO pins for TXD and RXD used for serial communication<br />
#define TXD_PIN 39<br />
#define RXD_PIN 38<br />
<br />
// Set the baud rate for Tuya module communication to 9600<br />
#define BAUD_RATE 9600<br />
<br />
// Define the response packets for different commands from the Tuya module<br />
<br />
// Heartbeat response: 55 AA 03 00 00 01 00 03<br />
uint8_t heartBeatResponse[] = {0x55, 0xAA, 0x03, 0x00, 0x00, 0x01, 0x00, 0x03};<br />
<br />
// Product info response with a detailed payload (e.g., firmware version, product name, etc.)<br />
uint8_t productInfoResponse[] = {<br />
  0x55, 0xAA, 0x03, 0x01, 0x00, 0x2A, 0x7B, 0x22, 0x70, 0x22, 0x3A, 0x22, <br />
  0x63, 0x68, 0x6D, 0x7A, 0x6C, 0x67, 0x6A, 0x70, 0x61, 0x64, 0x70, 0x71, <br />
  0x78, 0x64, 0x6B, 0x6F, 0x22, 0x2C, 0x22, 0x76, 0x22, 0x3A, 0x22, 0x31, <br />
  0x2E, 0x30, 0x2E, 0x30, 0x22, 0x2C, 0x22, 0x6D, 0x22, 0x3A, 0x30, 0x7D, 0xAA<br />
};<br />
<br />
// Work mode response: 55 AA 03 02 00 03 10 1C 14 47<br />
uint8_t workModeResponse[] = {0x55, 0xAA, 0x03, 0x02, 0x00, 0x03, 0x10, 0x1C, 0x14, 0x47};<br />
<br />
// Network status response: 55 AA 03 03 00 00 05<br />
uint8_t netStatusResponse[] = {0x55, 0xAA, 0x03, 0x03, 0x00, 0x00, 0x05};<br />
<br />
// Subsequent heartbeat response: 55 AA 03 00 00 01 01 04<br />
uint8_t secondHeartBeatResponse[] = {0x55, 0xAA, 0x03, 0x00, 0x00, 0x01, 0x01, 0x04};<br />
<br />
void setup() {<br />
  // Initialize the serial communication for debugging at 115200 baud rate<br />
  Serial.begin(115200);<br />
<br />
  // Initialize the serial communication with Tuya module at 9600 baud rate<br />
  tuyaSerial.begin(BAUD_RATE, SERIAL_8N1, RXD_PIN, TXD_PIN);<br />
<br />
  // Debug message to indicate that the serial communication has been initialized<br />
  Serial.println("ESP32-Tuya serial communication initialized.");<br />
}<br />
<br />
void loop() {<br />
  // Check if data is available from the Tuya module<br />
  if (tuyaSerial.available()) {<br />
    uint8_t incomingPacket[7];  // Array to store the received packet<br />
    size_t bytesRead = tuyaSerial.readBytes(incomingPacket, 7); // Read 7 bytes from Tuya<br />
<br />
    // Check if the packet has a valid header (0x55, 0xAA)<br />
    if (bytesRead &gt;= 2 &amp;&amp; incomingPacket[0] == 0x55 &amp;&amp; incomingPacket[1] == 0xAA) {<br />
      // If less than 7 bytes were received, wait for more data<br />
      if (bytesRead &lt; 7) {<br />
        Serial.println("Incomplete packet received. Waiting for remaining bytes...");<br />
        delay(50); // Delay to allow more data to be received<br />
        while (tuyaSerial.available()) {<br />
          incomingPacket[bytesRead++] = tuyaSerial.read(); // Continue reading remaining bytes<br />
          if (bytesRead &gt;= 7) break;<br />
        }<br />
      }<br />
<br />
      // If still less than 7 bytes, discard the incomplete packet<br />
      if (bytesRead &lt; 7) {<br />
        Serial.println("Error: Incomplete packet discarded.");<br />
        return;<br />
      }<br />
<br />
      // Debug: Print the received packet for logging<br />
      Serial.print("Received packet: ");<br />
      for (size_t i = 0; i &lt; 7; i++) {<br />
        Serial.print(incomingPacket[i], HEX);<br />
        Serial.print(" ");<br />
      }<br />
      Serial.println();<br />
<br />
      // Call the function to process the received packet<br />
      processTuyaPacket(incomingPacket, 7);<br />
<br />
    } else {<br />
      // If the header is invalid, discard the packet and flush the buffer<br />
      Serial.print("Error: Invalid packet header. Data received: ");<br />
      for (size_t i = 0; i &lt; bytesRead; i++) {<br />
        Serial.print(incomingPacket[i], HEX);<br />
        Serial.print(" ");<br />
      }<br />
      Serial.println();<br />
      tuyaSerial.flush(); // Clear the serial buffer<br />
    }<br />
  }<br />
<br />
  // Delay to avoid CPU overuse<br />
  delay(100);<br />
}<br />
<br />
// Function to process the received packet and send the appropriate response<br />
void processTuyaPacket(uint8_t* packet, size_t size) {<br />
  // Ensure the packet size is 7 and the header is valid<br />
  if (size == 7 &amp;&amp; packet[0] == 0x55 &amp;&amp; packet[1] == 0xAA) {<br />
    // Determine the command in the packet (packet[2])<br />
    switch(packet[2]) {<br />
      case 0x00:<br />
        if (packet[3] == 0x00 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x00 &amp;&amp; packet[6] == 0xFF) {<br />
          Serial.println("Heartbeat received.");<br />
          sendPacket(heartBeatResponse, sizeof(heartBeatResponse));<br />
        } else if (packet[3] == 0x01 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x00 &amp;&amp; packet[6] == 0x00) {<br />
          Serial.println("Product info request received.");<br />
          sendPacket(productInfoResponse, sizeof(productInfoResponse));<br />
        } else if (packet[3] == 0x02 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x00 &amp;&amp; packet[6] == 0x01) {<br />
          Serial.println("Work mode request received.");<br />
          sendPacket(workModeResponse, sizeof(workModeResponse));<br />
        } else if (packet[3] == 0x03 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x01 &amp;&amp; packet[6] == 0x00) {<br />
          Serial.println("Network status request received.");<br />
          sendPacket(netStatusResponse, sizeof(netStatusResponse));<br />
        }<br />
        break;<br />
<br />
      default:<br />
        Serial.println("Error: Unhandled command received.");<br />
        break;<br />
    }<br />
  }<br />
}<br />
<br />
// Function to send the response packet to the Tuya module<br />
void sendPacket(uint8_t* packet, size_t size) {<br />
  // Send the packet via UART to Tuya module<br />
  tuyaSerial.write(packet, size);<br />
<br />
  // Debug: Print the sent packet for logging<br />
  Serial.print("Sent packet: ");<br />
  for (size_t i = 0; i &lt; size; i++) {<br />
    Serial.print(packet[i], HEX);<br />
    Serial.print(" ");<br />
  }<br />
  Serial.println();<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8576" target="_blank" title="">9-tuya-wifi-config.zip</a> (Size: 2 KB / Downloads: 466)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 * <br />
 * This Arduino program implements communication between ESP32 and the Tuya module<br />
 * via UART (serial communication). It listens for specific packets from the Tuya module<br />
 * and responds according to the predefined commands.<br />
 * <br />
 * Functionality:<br />
 * 1. When the ESP32 receives a heartbeat packet (55 AA 00 00 00 00 FF),<br />
 *    it sends a heartbeat response (55 AA 03 00 00 01 00 03).<br />
 * 2. When the ESP32 receives a product information request (55 AA 00 01 00 00 00),<br />
 *    it sends a product information response (55 AA 03 01 ...).<br />
 * 3. When the ESP32 receives a work mode request (55 AA 00 02 00 00 01),<br />
 *    it sends a work mode response (55 AA 03 02 00 03 10 1C 14 47).<br />
 * 4. When the ESP32 receives a network status request (55 AA 00 03 00 01 00 03),<br />
 *    it sends a network status response (55 AA 03 03 00 00 05).<br />
 * 5. Subsequent heartbeat packets (55 AA 00 00 00 00 FF) are responded to with<br />
 *    (55 AA 03 00 00 01 01 04).<br />
 */<br />
<br />
#include &lt;HardwareSerial.h&gt;<br />
<br />
// Create a HardwareSerial object for UART communication on ESP32<br />
HardwareSerial tuyaSerial(1);<br />
<br />
// Define the GPIO pins for TXD and RXD used for serial communication<br />
#define TXD_PIN 39<br />
#define RXD_PIN 38<br />
<br />
// Set the baud rate for Tuya module communication to 9600<br />
#define BAUD_RATE 9600<br />
<br />
// Define the response packets for different commands from the Tuya module<br />
<br />
// Heartbeat response: 55 AA 03 00 00 01 00 03<br />
uint8_t heartBeatResponse[] = {0x55, 0xAA, 0x03, 0x00, 0x00, 0x01, 0x00, 0x03};<br />
<br />
// Product info response with a detailed payload (e.g., firmware version, product name, etc.)<br />
uint8_t productInfoResponse[] = {<br />
  0x55, 0xAA, 0x03, 0x01, 0x00, 0x2A, 0x7B, 0x22, 0x70, 0x22, 0x3A, 0x22, <br />
  0x63, 0x68, 0x6D, 0x7A, 0x6C, 0x67, 0x6A, 0x70, 0x61, 0x64, 0x70, 0x71, <br />
  0x78, 0x64, 0x6B, 0x6F, 0x22, 0x2C, 0x22, 0x76, 0x22, 0x3A, 0x22, 0x31, <br />
  0x2E, 0x30, 0x2E, 0x30, 0x22, 0x2C, 0x22, 0x6D, 0x22, 0x3A, 0x30, 0x7D, 0xAA<br />
};<br />
<br />
// Work mode response: 55 AA 03 02 00 03 10 1C 14 47<br />
uint8_t workModeResponse[] = {0x55, 0xAA, 0x03, 0x02, 0x00, 0x03, 0x10, 0x1C, 0x14, 0x47};<br />
<br />
// Network status response: 55 AA 03 03 00 00 05<br />
uint8_t netStatusResponse[] = {0x55, 0xAA, 0x03, 0x03, 0x00, 0x00, 0x05};<br />
<br />
// Subsequent heartbeat response: 55 AA 03 00 00 01 01 04<br />
uint8_t secondHeartBeatResponse[] = {0x55, 0xAA, 0x03, 0x00, 0x00, 0x01, 0x01, 0x04};<br />
<br />
void setup() {<br />
  // Initialize the serial communication for debugging at 115200 baud rate<br />
  Serial.begin(115200);<br />
<br />
  // Initialize the serial communication with Tuya module at 9600 baud rate<br />
  tuyaSerial.begin(BAUD_RATE, SERIAL_8N1, RXD_PIN, TXD_PIN);<br />
<br />
  // Debug message to indicate that the serial communication has been initialized<br />
  Serial.println("ESP32-Tuya serial communication initialized.");<br />
}<br />
<br />
void loop() {<br />
  // Check if data is available from the Tuya module<br />
  if (tuyaSerial.available()) {<br />
    uint8_t incomingPacket[7];  // Array to store the received packet<br />
    size_t bytesRead = tuyaSerial.readBytes(incomingPacket, 7); // Read 7 bytes from Tuya<br />
<br />
    // Check if the packet has a valid header (0x55, 0xAA)<br />
    if (bytesRead &gt;= 2 &amp;&amp; incomingPacket[0] == 0x55 &amp;&amp; incomingPacket[1] == 0xAA) {<br />
      // If less than 7 bytes were received, wait for more data<br />
      if (bytesRead &lt; 7) {<br />
        Serial.println("Incomplete packet received. Waiting for remaining bytes...");<br />
        delay(50); // Delay to allow more data to be received<br />
        while (tuyaSerial.available()) {<br />
          incomingPacket[bytesRead++] = tuyaSerial.read(); // Continue reading remaining bytes<br />
          if (bytesRead &gt;= 7) break;<br />
        }<br />
      }<br />
<br />
      // If still less than 7 bytes, discard the incomplete packet<br />
      if (bytesRead &lt; 7) {<br />
        Serial.println("Error: Incomplete packet discarded.");<br />
        return;<br />
      }<br />
<br />
      // Debug: Print the received packet for logging<br />
      Serial.print("Received packet: ");<br />
      for (size_t i = 0; i &lt; 7; i++) {<br />
        Serial.print(incomingPacket[i], HEX);<br />
        Serial.print(" ");<br />
      }<br />
      Serial.println();<br />
<br />
      // Call the function to process the received packet<br />
      processTuyaPacket(incomingPacket, 7);<br />
<br />
    } else {<br />
      // If the header is invalid, discard the packet and flush the buffer<br />
      Serial.print("Error: Invalid packet header. Data received: ");<br />
      for (size_t i = 0; i &lt; bytesRead; i++) {<br />
        Serial.print(incomingPacket[i], HEX);<br />
        Serial.print(" ");<br />
      }<br />
      Serial.println();<br />
      tuyaSerial.flush(); // Clear the serial buffer<br />
    }<br />
  }<br />
<br />
  // Delay to avoid CPU overuse<br />
  delay(100);<br />
}<br />
<br />
// Function to process the received packet and send the appropriate response<br />
void processTuyaPacket(uint8_t* packet, size_t size) {<br />
  // Ensure the packet size is 7 and the header is valid<br />
  if (size == 7 &amp;&amp; packet[0] == 0x55 &amp;&amp; packet[1] == 0xAA) {<br />
    // Determine the command in the packet (packet[2])<br />
    switch(packet[2]) {<br />
      case 0x00:<br />
        if (packet[3] == 0x00 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x00 &amp;&amp; packet[6] == 0xFF) {<br />
          Serial.println("Heartbeat received.");<br />
          sendPacket(heartBeatResponse, sizeof(heartBeatResponse));<br />
        } else if (packet[3] == 0x01 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x00 &amp;&amp; packet[6] == 0x00) {<br />
          Serial.println("Product info request received.");<br />
          sendPacket(productInfoResponse, sizeof(productInfoResponse));<br />
        } else if (packet[3] == 0x02 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x00 &amp;&amp; packet[6] == 0x01) {<br />
          Serial.println("Work mode request received.");<br />
          sendPacket(workModeResponse, sizeof(workModeResponse));<br />
        } else if (packet[3] == 0x03 &amp;&amp; packet[4] == 0x00 &amp;&amp; packet[5] == 0x01 &amp;&amp; packet[6] == 0x00) {<br />
          Serial.println("Network status request received.");<br />
          sendPacket(netStatusResponse, sizeof(netStatusResponse));<br />
        }<br />
        break;<br />
<br />
      default:<br />
        Serial.println("Error: Unhandled command received.");<br />
        break;<br />
    }<br />
  }<br />
}<br />
<br />
// Function to send the response packet to the Tuya module<br />
void sendPacket(uint8_t* packet, size_t size) {<br />
  // Send the packet via UART to Tuya module<br />
  tuyaSerial.write(packet, size);<br />
<br />
  // Debug: Print the sent packet for logging<br />
  Serial.print("Sent packet: ");<br />
  for (size_t i = 0; i &lt; size; i++) {<br />
    Serial.print(packet[i], HEX);<br />
    Serial.print(" ");<br />
  }<br />
  Serial.println();<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8576" target="_blank" title="">9-tuya-wifi-config.zip</a> (Size: 2 KB / Downloads: 466)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-08 Ethernet W5500 chip work with TCP Server mode]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8705</link>
			<pubDate>Thu, 28 Nov 2024 19:48:30 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8705</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This Arduino program sets up an ESP32-S3 with a W5500 Ethernet module<br />
 * as a TCP server. It listens on port 4196 and echoes back any string <br />
 * received from a client.<br />
 *<br />
 * Hardware connections:<br />
 * - CLK: GPIO42<br />
 * - MOSI: GPIO43<br />
 * - MISO: GPIO44<br />
 * - CS: GPIO41<br />
 * - RST: GPIO1<br />
 * - INT: GPIO2<br />
 *<br />
 * Static IP address: 192.168.3.55<br />
 * Subnet Mask: 255.255.255.0<br />
 * Gateway: 192.168.3.1<br />
 * DNS: 192.168.3.1<br />
 */<br />
<br />
#include &lt;SPI.h&gt;<br />
#include &lt;Ethernet.h&gt;<br />
<br />
// Define the W5500 Ethernet module pins<br />
#define W5500_CS_PIN  41<br />
#define W5500_RST_PIN 1<br />
#define W5500_INT_PIN 2<br />
#define W5500_CLK_PIN 42<br />
#define W5500_MOSI_PIN 43<br />
#define W5500_MISO_PIN 44<br />
<br />
// MAC address for your Ethernet shield (must be unique on your network)<br />
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };<br />
<br />
// Static IP address configuration<br />
IPAddress ip(192, 168, 3, 55);     &nbsp;&nbsp;// Static IP address<br />
IPAddress subnet(255, 255, 255, 0); &nbsp;&nbsp;// Subnet mask<br />
IPAddress gateway(192, 168, 3, 1);    // Default gateway<br />
IPAddress dns(192, 168, 3, 1);        // DNS server address<br />
<br />
// Create an EthernetServer object to handle TCP connections<br />
EthernetServer server(4196);<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  while (!Serial) {<br />
    ; // Wait for serial port to connect<br />
  }<br />
<br />
  // Initialize the W5500 module<br />
  pinMode(W5500_RST_PIN, OUTPUT);<br />
  pinMode(W5500_INT_PIN, INPUT);<br />
  digitalWrite(W5500_RST_PIN, LOW);  // Reset the W5500 module<br />
  delay(100);                     &nbsp;&nbsp;// Wait for reset to complete<br />
  digitalWrite(W5500_RST_PIN, HIGH); // Release reset<br />
<br />
  // Initialize SPI with the correct pin definitions<br />
  SPI.begin(W5500_CLK_PIN, W5500_MISO_PIN, W5500_MOSI_PIN);<br />
<br />
  // Set up the Ethernet library with W5500-specific pins<br />
  Ethernet.init(W5500_CS_PIN);<br />
<br />
  // Start the Ethernet connection with static IP configuration<br />
  Ethernet.begin(mac, ip, dns, gateway, subnet);<br />
<br />
  // Print the IP address to the serial monitor<br />
  Serial.print("IP Address: ");<br />
  Serial.println(Ethernet.localIP());<br />
<br />
  // Start listening for incoming TCP connections<br />
  server.begin();<br />
}<br />
<br />
void loop() {<br />
  // Check for incoming client connections<br />
  EthernetClient client = server.available();<br />
  if (client) {<br />
    Serial.println("New client connected");<br />
<br />
    // Read data from the client and echo it back<br />
    while (client.connected()) {<br />
      if (client.available()) {<br />
        char c = client.read();<br />
        server.write(c);<br />
      }<br />
    }<br />
<br />
    // Close the connection when done<br />
    client.stop();<br />
    Serial.println("Client disconnected");<br />
  }<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8575" target="_blank" title="">8-Ethernet-W5500.zip</a> (Size: 1.23 KB / Downloads: 426)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * This Arduino program sets up an ESP32-S3 with a W5500 Ethernet module<br />
 * as a TCP server. It listens on port 4196 and echoes back any string <br />
 * received from a client.<br />
 *<br />
 * Hardware connections:<br />
 * - CLK: GPIO42<br />
 * - MOSI: GPIO43<br />
 * - MISO: GPIO44<br />
 * - CS: GPIO41<br />
 * - RST: GPIO1<br />
 * - INT: GPIO2<br />
 *<br />
 * Static IP address: 192.168.3.55<br />
 * Subnet Mask: 255.255.255.0<br />
 * Gateway: 192.168.3.1<br />
 * DNS: 192.168.3.1<br />
 */<br />
<br />
#include &lt;SPI.h&gt;<br />
#include &lt;Ethernet.h&gt;<br />
<br />
// Define the W5500 Ethernet module pins<br />
#define W5500_CS_PIN  41<br />
#define W5500_RST_PIN 1<br />
#define W5500_INT_PIN 2<br />
#define W5500_CLK_PIN 42<br />
#define W5500_MOSI_PIN 43<br />
#define W5500_MISO_PIN 44<br />
<br />
// MAC address for your Ethernet shield (must be unique on your network)<br />
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };<br />
<br />
// Static IP address configuration<br />
IPAddress ip(192, 168, 3, 55);     &nbsp;&nbsp;// Static IP address<br />
IPAddress subnet(255, 255, 255, 0); &nbsp;&nbsp;// Subnet mask<br />
IPAddress gateway(192, 168, 3, 1);    // Default gateway<br />
IPAddress dns(192, 168, 3, 1);        // DNS server address<br />
<br />
// Create an EthernetServer object to handle TCP connections<br />
EthernetServer server(4196);<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  while (!Serial) {<br />
    ; // Wait for serial port to connect<br />
  }<br />
<br />
  // Initialize the W5500 module<br />
  pinMode(W5500_RST_PIN, OUTPUT);<br />
  pinMode(W5500_INT_PIN, INPUT);<br />
  digitalWrite(W5500_RST_PIN, LOW);  // Reset the W5500 module<br />
  delay(100);                     &nbsp;&nbsp;// Wait for reset to complete<br />
  digitalWrite(W5500_RST_PIN, HIGH); // Release reset<br />
<br />
  // Initialize SPI with the correct pin definitions<br />
  SPI.begin(W5500_CLK_PIN, W5500_MISO_PIN, W5500_MOSI_PIN);<br />
<br />
  // Set up the Ethernet library with W5500-specific pins<br />
  Ethernet.init(W5500_CS_PIN);<br />
<br />
  // Start the Ethernet connection with static IP configuration<br />
  Ethernet.begin(mac, ip, dns, gateway, subnet);<br />
<br />
  // Print the IP address to the serial monitor<br />
  Serial.print("IP Address: ");<br />
  Serial.println(Ethernet.localIP());<br />
<br />
  // Start listening for incoming TCP connections<br />
  server.begin();<br />
}<br />
<br />
void loop() {<br />
  // Check for incoming client connections<br />
  EthernetClient client = server.available();<br />
  if (client) {<br />
    Serial.println("New client connected");<br />
<br />
    // Read data from the client and echo it back<br />
    while (client.connected()) {<br />
      if (client.available()) {<br />
        char c = client.read();<br />
        server.write(c);<br />
      }<br />
    }<br />
<br />
    // Close the connection when done<br />
    client.stop();<br />
    Serial.println("Client disconnected");<br />
  }<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8575" target="_blank" title="">8-Ethernet-W5500.zip</a> (Size: 1.23 KB / Downloads: 426)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-07 how to DS3231 RTC clock]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8704</link>
			<pubDate>Thu, 28 Nov 2024 19:47:21 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8704</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * DS3231 RTC with Arduino<br />
 *<br />
 * This program demonstrates how to use the DS3231 RTC (Real-Time Clock) module with the Arduino.<br />
 * It includes functionality to:<br />
 * - Initialize the DS3231 RTC module<br />
 * - Read the current date and time from the RTC<br />
 * - Set the RTC time based on a serial command:Command format: DYYYY-MM-DDTHH:MM:SS<br />
 *<br />
 * Hardware Connections:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 */<br />
<br />
#include &lt;DS3231.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
String serial_cmd_rcv = ""; // Serial port receiver<br />
<br />
typedef struct<br />
{<br />
  byte year;    // Last two digits of the year, library adds 2000.<br />
  byte month;<br />
  byte day;<br />
  byte hour;<br />
  byte minute;<br />
  byte second;<br />
} MY_DATE_STR;<br />
<br />
MY_DATE_STR my_date_str = {0};<br />
<br />
// Define constants for relay control<br />
#define OPEN_RLY_DATA    26<br />
#define OPEN_RLY_MONTH &nbsp;&nbsp;4<br />
#define CLOSE_RLY_DATA &nbsp;&nbsp;2<br />
#define CLOSE_RLY_MONTH  5<br />
<br />
// Define pin connections<br />
#define SDA_PIN &nbsp;&nbsp;8<br />
#define SCL_PIN &nbsp;&nbsp;18<br />
<br />
DS3231 rtc; // Create an instance of the DS3231 RTC<br />
bool h12Flag;<br />
bool pmFlag;<br />
static bool bCentury = false;<br />
static bool old_level_high = false;<br />
static bool old_level_low = false;<br />
<br />
<br />
/**<br />
 * @brief Print the current time from the RTC to the Serial Monitor.<br />
 */<br />
static void PrintfCurTime()<br />
{<br />
  Serial.print("Current time is: ");<br />
  int year = rtc.getYear() + 2000;<br />
  Serial.print(year);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getMonth(bCentury), DEC);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getDate(), DEC);<br />
  Serial.print(" ");<br />
<br />
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);<br />
  Serial.print(":");<br />
  Serial.print(rtc.getMinute(), DEC);<br />
  Serial.print(":");<br />
  Serial.println(rtc.getSecond(), DEC);<br />
}<br />
<br />
/**<br />
 * @brief Process serial commands to set the RTC time.<br />
 * Command format: DYYYY-MM-DDTHH:MM:SS<br />
 */<br />
static void GetSerialCmd()<br />
{<br />
  if (Serial.available() &gt; 0)<br />
  {<br />
    delay(100);<br />
    int num_read = Serial.available();<br />
    while (num_read--)<br />
      serial_cmd_rcv += char(Serial.read());<br />
  }<br />
  else return;<br />
<br />
  serial_cmd_rcv.trim();<br />
<br />
  if (serial_cmd_rcv == "current time")<br />
  {<br />
    PrintfCurTime();<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.print("Received length: ");<br />
  Serial.println(serial_cmd_rcv.length());<br />
<br />
  int indexof_d = serial_cmd_rcv.indexOf('D');<br />
  int indexof_t = serial_cmd_rcv.indexOf('T');<br />
<br />
  Serial.print("D index: ");<br />
  Serial.print(indexof_d);<br />
  Serial.print(" T index: ");<br />
  Serial.println(indexof_t);<br />
<br />
  if (serial_cmd_rcv.length() != 20 || <br />
      serial_cmd_rcv.substring(0, 1) != "D" ||<br />
      serial_cmd_rcv.substring(11, 12) != "T")  <br />
  {<br />
    Serial.println(serial_cmd_rcv);<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.println("Setting time...");<br />
<br />
  my_date_str.year = (byte)serial_cmd_rcv.substring(3, 5).toInt();<br />
  my_date_str.month = (byte)serial_cmd_rcv.substring(6, 8).toInt();<br />
  my_date_str.day = (byte)serial_cmd_rcv.substring(9, 11).toInt();<br />
  my_date_str.hour = (byte)serial_cmd_rcv.substring(12, 14).toInt();<br />
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15, 17).toInt();<br />
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();<br />
<br />
  rtc.setYear(my_date_str.year);<br />
  rtc.setMonth(my_date_str.month);<br />
  rtc.setDate(my_date_str.day);<br />
  rtc.setHour(my_date_str.hour);<br />
  rtc.setMinute(my_date_str.minute);<br />
  rtc.setSecond(my_date_str.second);<br />
<br />
  serial_cmd_rcv = "";<br />
<br />
  Serial.println("Time set.");<br />
}<br />
<br />
void setup() {<br />
  // Initialize the I2C interface<br />
  Wire.begin(SDA_PIN, SCL_PIN, 40000);<br />
  <br />
  // Initialize Serial communication<br />
  Serial.begin(115200);<br />
 &nbsp;&nbsp;<br />
  // Set the RTC to 24-hour mode<br />
  rtc.setClockMode(false); // 24-hour format<br />
<br />
  // Print current time to Serial Monitor<br />
  PrintfCurTime();<br />
<br />
  // Clear any remaining serial data<br />
  while (Serial.read() &gt;= 0) {}<br />
}<br />
<br />
void loop() {<br />
  // Process incoming serial commands<br />
  GetSerialCmd(); <br />
  delay(1000); // Delay for 1 second<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8574" target="_blank" title="">7-DS3231-RTC.zip</a> (Size: 1.51 KB / Downloads: 454)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * DS3231 RTC with Arduino<br />
 *<br />
 * This program demonstrates how to use the DS3231 RTC (Real-Time Clock) module with the Arduino.<br />
 * It includes functionality to:<br />
 * - Initialize the DS3231 RTC module<br />
 * - Read the current date and time from the RTC<br />
 * - Set the RTC time based on a serial command:Command format: DYYYY-MM-DDTHH:MM:SS<br />
 *<br />
 * Hardware Connections:<br />
 * - SDA: GPIO 8<br />
 * - SCL: GPIO 18<br />
 */<br />
<br />
#include &lt;DS3231.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
String serial_cmd_rcv = ""; // Serial port receiver<br />
<br />
typedef struct<br />
{<br />
  byte year;    // Last two digits of the year, library adds 2000.<br />
  byte month;<br />
  byte day;<br />
  byte hour;<br />
  byte minute;<br />
  byte second;<br />
} MY_DATE_STR;<br />
<br />
MY_DATE_STR my_date_str = {0};<br />
<br />
// Define constants for relay control<br />
#define OPEN_RLY_DATA    26<br />
#define OPEN_RLY_MONTH &nbsp;&nbsp;4<br />
#define CLOSE_RLY_DATA &nbsp;&nbsp;2<br />
#define CLOSE_RLY_MONTH  5<br />
<br />
// Define pin connections<br />
#define SDA_PIN &nbsp;&nbsp;8<br />
#define SCL_PIN &nbsp;&nbsp;18<br />
<br />
DS3231 rtc; // Create an instance of the DS3231 RTC<br />
bool h12Flag;<br />
bool pmFlag;<br />
static bool bCentury = false;<br />
static bool old_level_high = false;<br />
static bool old_level_low = false;<br />
<br />
<br />
/**<br />
 * @brief Print the current time from the RTC to the Serial Monitor.<br />
 */<br />
static void PrintfCurTime()<br />
{<br />
  Serial.print("Current time is: ");<br />
  int year = rtc.getYear() + 2000;<br />
  Serial.print(year);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getMonth(bCentury), DEC);<br />
  Serial.print("-");<br />
<br />
  Serial.print(rtc.getDate(), DEC);<br />
  Serial.print(" ");<br />
<br />
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);<br />
  Serial.print(":");<br />
  Serial.print(rtc.getMinute(), DEC);<br />
  Serial.print(":");<br />
  Serial.println(rtc.getSecond(), DEC);<br />
}<br />
<br />
/**<br />
 * @brief Process serial commands to set the RTC time.<br />
 * Command format: DYYYY-MM-DDTHH:MM:SS<br />
 */<br />
static void GetSerialCmd()<br />
{<br />
  if (Serial.available() &gt; 0)<br />
  {<br />
    delay(100);<br />
    int num_read = Serial.available();<br />
    while (num_read--)<br />
      serial_cmd_rcv += char(Serial.read());<br />
  }<br />
  else return;<br />
<br />
  serial_cmd_rcv.trim();<br />
<br />
  if (serial_cmd_rcv == "current time")<br />
  {<br />
    PrintfCurTime();<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.print("Received length: ");<br />
  Serial.println(serial_cmd_rcv.length());<br />
<br />
  int indexof_d = serial_cmd_rcv.indexOf('D');<br />
  int indexof_t = serial_cmd_rcv.indexOf('T');<br />
<br />
  Serial.print("D index: ");<br />
  Serial.print(indexof_d);<br />
  Serial.print(" T index: ");<br />
  Serial.println(indexof_t);<br />
<br />
  if (serial_cmd_rcv.length() != 20 || <br />
      serial_cmd_rcv.substring(0, 1) != "D" ||<br />
      serial_cmd_rcv.substring(11, 12) != "T")  <br />
  {<br />
    Serial.println(serial_cmd_rcv);<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.println("Setting time...");<br />
<br />
  my_date_str.year = (byte)serial_cmd_rcv.substring(3, 5).toInt();<br />
  my_date_str.month = (byte)serial_cmd_rcv.substring(6, 8).toInt();<br />
  my_date_str.day = (byte)serial_cmd_rcv.substring(9, 11).toInt();<br />
  my_date_str.hour = (byte)serial_cmd_rcv.substring(12, 14).toInt();<br />
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15, 17).toInt();<br />
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();<br />
<br />
  rtc.setYear(my_date_str.year);<br />
  rtc.setMonth(my_date_str.month);<br />
  rtc.setDate(my_date_str.day);<br />
  rtc.setHour(my_date_str.hour);<br />
  rtc.setMinute(my_date_str.minute);<br />
  rtc.setSecond(my_date_str.second);<br />
<br />
  serial_cmd_rcv = "";<br />
<br />
  Serial.println("Time set.");<br />
}<br />
<br />
void setup() {<br />
  // Initialize the I2C interface<br />
  Wire.begin(SDA_PIN, SCL_PIN, 40000);<br />
  <br />
  // Initialize Serial communication<br />
  Serial.begin(115200);<br />
 &nbsp;&nbsp;<br />
  // Set the RTC to 24-hour mode<br />
  rtc.setClockMode(false); // 24-hour format<br />
<br />
  // Print current time to Serial Monitor<br />
  PrintfCurTime();<br />
<br />
  // Clear any remaining serial data<br />
  while (Serial.read() &gt;= 0) {}<br />
}<br />
<br />
void loop() {<br />
  // Process incoming serial commands<br />
  GetSerialCmd(); <br />
  delay(1000); // Delay for 1 second<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8574" target="_blank" title="">7-DS3231-RTC.zip</a> (Size: 1.51 KB / Downloads: 454)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-06 How to use SD Card]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8703</link>
			<pubDate>Thu, 28 Nov 2024 19:46:16 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8703</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * SD Card File Operations<br />
 *<br />
 * This program demonstrates basic file operations on an SD card using the ESP32.<br />
 * It includes functionality to:<br />
 * - Initialize and test the SD card<br />
 * - Read from, write to, append to, and delete files on the SD card<br />
 * - Measure file read and write performance<br />
 *<br />
 * Hardware Connections:<br />
 * - SCK: GPIO 11<br />
 * - MISO: GPIO 12<br />
 * - MOSI: GPIO 10<br />
 * - CS: GPIO 9<br />
 */<br />
<br />
#include "FS.h"<br />
#include "SD.h"<br />
#include "SPI.h"<br />
<br />
// Pin definitions for SD card<br />
#define SCK  11<br />
#define MISO 12<br />
#define MOSI 10<br />
#define CS &nbsp;&nbsp;9<br />
<br />
/**<br />
 * @brief Reads the contents of a file from the SD card and prints it to the serial monitor.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to read.<br />
 */<br />
void readFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Reading file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for reading");<br />
    return;<br />
  }<br />
<br />
  Serial.print("Read from file: ");<br />
  while (file.available()) {<br />
    Serial.print((char)file.read());<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Writes a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to write.<br />
 * @param message Message to write to the file.<br />
 */<br />
void writeFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Writing file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("File written");<br />
  } else {<br />
    Serial.println("Write failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Appends a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to append.<br />
 * @param message Message to append to the file.<br />
 */<br />
void appendFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Appending to file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_APPEND);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for appending");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("Message appended");<br />
  } else {<br />
    Serial.println("Append failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Deletes a file from the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to delete.<br />
 */<br />
void deleteFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Deleting file: %s&#92;n", path);<br />
  if (fs.remove(path)) {<br />
    Serial.println("File deleted");<br />
  } else {<br />
    Serial.println("Delete failed");<br />
  }<br />
}<br />
<br />
/**<br />
 * @brief Tests file read and write performance.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to test.<br />
 */<br />
void testFileIO(fs::FS &amp;fs, const char * path) {<br />
  File file = fs.open(path);<br />
  static uint8_t buf[512];<br />
  size_t len = 0;<br />
  uint32_t start = millis();<br />
  uint32_t end = start;<br />
<br />
  if (file) {<br />
    len = file.size();<br />
    size_t flen = len;<br />
    start = millis();<br />
    while (len) {<br />
      size_t toRead = len;<br />
      if (toRead &gt; 512) {<br />
        toRead = 512;<br />
      }<br />
      file.read(buf, toRead);<br />
      len -= toRead;<br />
    }<br />
    end = millis() - start;<br />
    Serial.printf("%u bytes read for %u ms&#92;n", flen, end);<br />
    file.close();<br />
  } else {<br />
    Serial.println("Failed to open file for reading");<br />
  }<br />
<br />
  file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
<br />
  size_t i;<br />
  start = millis();<br />
  for (i = 0; i &lt; 2048; i++) {<br />
    file.write(buf, 512);<br />
  }<br />
  end = millis() - start;<br />
  Serial.printf("%u bytes written for %u ms&#92;n", 2048 * 512, end);<br />
  file.close();<br />
}<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  <br />
  // Initialize SPI and SD card<br />
  SPIClass spi = SPIClass(HSPI);<br />
  spi.begin(SCK, MISO, MOSI, CS);<br />
<br />
  if (!SD.begin(CS, spi, 80000000)) {<br />
    Serial.println("Card Mount Failed");<br />
    return;<br />
  }<br />
<br />
  uint8_t cardType = SD.cardType();<br />
<br />
  if (cardType == CARD_NONE) {<br />
    Serial.println("No SD card attached");<br />
    return;<br />
  }<br />
<br />
  Serial.print("SD Card Type: ");<br />
  if (cardType == CARD_MMC) {<br />
    Serial.println("MMC");<br />
  } else if (cardType == CARD_SD) {<br />
    Serial.println("SDSC");<br />
  } else if (cardType == CARD_SDHC) {<br />
    Serial.println("SDHC");<br />
  } else {<br />
    Serial.println("UNKNOWN");<br />
  }<br />
<br />
  uint64_t cardSize = SD.cardSize() / (1024 * 1024);<br />
  Serial.printf("SD Card Size: %lluMB&#92;n", cardSize);<br />
  delay(2000);<br />
<br />
  // Perform file operations<br />
  deleteFile(SD, "/hello.txt");<br />
  writeFile(SD, "/hello.txt", "Hello ");<br />
  appendFile(SD, "/hello.txt", "World!&#92;n");<br />
  readFile(SD, "/hello.txt");<br />
  testFileIO(SD, "/test.txt");<br />
  Serial.printf("Total space: %lluMB&#92;n", SD.totalBytes() / (1024 * 1024));<br />
  Serial.printf("Used space: %lluMB&#92;n", SD.usedBytes() / (1024 * 1024));<br />
}<br />
<br />
void loop() {<br />
  // No operation in loop<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8573" target="_blank" title="">6-SD.zip</a> (Size: 1.53 KB / Downloads: 441)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * SD Card File Operations<br />
 *<br />
 * This program demonstrates basic file operations on an SD card using the ESP32.<br />
 * It includes functionality to:<br />
 * - Initialize and test the SD card<br />
 * - Read from, write to, append to, and delete files on the SD card<br />
 * - Measure file read and write performance<br />
 *<br />
 * Hardware Connections:<br />
 * - SCK: GPIO 11<br />
 * - MISO: GPIO 12<br />
 * - MOSI: GPIO 10<br />
 * - CS: GPIO 9<br />
 */<br />
<br />
#include "FS.h"<br />
#include "SD.h"<br />
#include "SPI.h"<br />
<br />
// Pin definitions for SD card<br />
#define SCK  11<br />
#define MISO 12<br />
#define MOSI 10<br />
#define CS &nbsp;&nbsp;9<br />
<br />
/**<br />
 * @brief Reads the contents of a file from the SD card and prints it to the serial monitor.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to read.<br />
 */<br />
void readFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Reading file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for reading");<br />
    return;<br />
  }<br />
<br />
  Serial.print("Read from file: ");<br />
  while (file.available()) {<br />
    Serial.print((char)file.read());<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Writes a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to write.<br />
 * @param message Message to write to the file.<br />
 */<br />
void writeFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Writing file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("File written");<br />
  } else {<br />
    Serial.println("Write failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Appends a message to a file on the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to append.<br />
 * @param message Message to append to the file.<br />
 */<br />
void appendFile(fs::FS &amp;fs, const char * path, const char * message) {<br />
  Serial.printf("Appending to file: %s&#92;n", path);<br />
<br />
  File file = fs.open(path, FILE_APPEND);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for appending");<br />
    return;<br />
  }<br />
  if (file.print(message)) {<br />
    Serial.println("Message appended");<br />
  } else {<br />
    Serial.println("Append failed");<br />
  }<br />
  file.close();<br />
}<br />
<br />
/**<br />
 * @brief Deletes a file from the SD card.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to delete.<br />
 */<br />
void deleteFile(fs::FS &amp;fs, const char * path) {<br />
  Serial.printf("Deleting file: %s&#92;n", path);<br />
  if (fs.remove(path)) {<br />
    Serial.println("File deleted");<br />
  } else {<br />
    Serial.println("Delete failed");<br />
  }<br />
}<br />
<br />
/**<br />
 * @brief Tests file read and write performance.<br />
 * <br />
 * @param fs File system to use (in this case, SD).<br />
 * @param path Path of the file to test.<br />
 */<br />
void testFileIO(fs::FS &amp;fs, const char * path) {<br />
  File file = fs.open(path);<br />
  static uint8_t buf[512];<br />
  size_t len = 0;<br />
  uint32_t start = millis();<br />
  uint32_t end = start;<br />
<br />
  if (file) {<br />
    len = file.size();<br />
    size_t flen = len;<br />
    start = millis();<br />
    while (len) {<br />
      size_t toRead = len;<br />
      if (toRead &gt; 512) {<br />
        toRead = 512;<br />
      }<br />
      file.read(buf, toRead);<br />
      len -= toRead;<br />
    }<br />
    end = millis() - start;<br />
    Serial.printf("%u bytes read for %u ms&#92;n", flen, end);<br />
    file.close();<br />
  } else {<br />
    Serial.println("Failed to open file for reading");<br />
  }<br />
<br />
  file = fs.open(path, FILE_WRITE);<br />
  if (!file) {<br />
    Serial.println("Failed to open file for writing");<br />
    return;<br />
  }<br />
<br />
  size_t i;<br />
  start = millis();<br />
  for (i = 0; i &lt; 2048; i++) {<br />
    file.write(buf, 512);<br />
  }<br />
  end = millis() - start;<br />
  Serial.printf("%u bytes written for %u ms&#92;n", 2048 * 512, end);<br />
  file.close();<br />
}<br />
<br />
void setup() {<br />
  // Initialize serial communication<br />
  Serial.begin(115200);<br />
  <br />
  // Initialize SPI and SD card<br />
  SPIClass spi = SPIClass(HSPI);<br />
  spi.begin(SCK, MISO, MOSI, CS);<br />
<br />
  if (!SD.begin(CS, spi, 80000000)) {<br />
    Serial.println("Card Mount Failed");<br />
    return;<br />
  }<br />
<br />
  uint8_t cardType = SD.cardType();<br />
<br />
  if (cardType == CARD_NONE) {<br />
    Serial.println("No SD card attached");<br />
    return;<br />
  }<br />
<br />
  Serial.print("SD Card Type: ");<br />
  if (cardType == CARD_MMC) {<br />
    Serial.println("MMC");<br />
  } else if (cardType == CARD_SD) {<br />
    Serial.println("SDSC");<br />
  } else if (cardType == CARD_SDHC) {<br />
    Serial.println("SDHC");<br />
  } else {<br />
    Serial.println("UNKNOWN");<br />
  }<br />
<br />
  uint64_t cardSize = SD.cardSize() / (1024 * 1024);<br />
  Serial.printf("SD Card Size: %lluMB&#92;n", cardSize);<br />
  delay(2000);<br />
<br />
  // Perform file operations<br />
  deleteFile(SD, "/hello.txt");<br />
  writeFile(SD, "/hello.txt", "Hello ");<br />
  appendFile(SD, "/hello.txt", "World!&#92;n");<br />
  readFile(SD, "/hello.txt");<br />
  testFileIO(SD, "/test.txt");<br />
  Serial.printf("Total space: %lluMB&#92;n", SD.totalBytes() / (1024 * 1024));<br />
  Serial.printf("Used space: %lluMB&#92;n", SD.usedBytes() / (1024 * 1024));<br />
}<br />
<br />
void loop() {<br />
  // No operation in loop<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8573" target="_blank" title="">6-SD.zip</a> (Size: 1.53 KB / Downloads: 441)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-05 Read free GPIO state]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8702</link>
			<pubDate>Thu, 28 Nov 2024 19:45:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8702</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * GPIO Status Monitoring<br />
 *<br />
 * This program monitors the status (high or low) of multiple GPIO pins on the ESP32-S3.<br />
 * It prints the status of the pins to the serial monitor whenever a change is detected.<br />
 *<br />
 * GPIO Pins Monitored:<br />
 * - GPIO 48<br />
 * - GPIO 47<br />
 * - GPIO 21<br />
 * - GPIO 15<br />
 * - GPIO 14<br />
 * - GPIO 13<br />
 * - GPIO 12<br />
 * - GPIO 40<br />
 *<br />
 * Hardware Requirements:<br />
 * - Connect the pins to appropriate devices or pull them to HIGH/LOW for testing<br />
 */<br />
<br />
#define GPIO_PIN_48 48<br />
#define GPIO_PIN_47 47<br />
#define GPIO_PIN_21 21<br />
#define GPIO_PIN_15 15<br />
#define GPIO_PIN_14 14<br />
#define GPIO_PIN_13 13<br />
#define GPIO_PIN_12 12<br />
#define GPIO_PIN_40 40<br />
<br />
// Store the previous state of the GPIO pins<br />
bool prevState[8] = {false, false, false, false, false, false, false, false};<br />
<br />
void setup() {<br />
  // Initialize serial communication for debugging purposes<br />
  Serial.begin(115200); // Initialize the serial monitor at 115200 baud<br />
  while (!Serial);      // Wait for the serial monitor to open<br />
<br />
  // Initialize GPIO pins as inputs<br />
  pinMode(GPIO_PIN_48, INPUT);<br />
  pinMode(GPIO_PIN_47, INPUT);<br />
  pinMode(GPIO_PIN_21, INPUT);<br />
  pinMode(GPIO_PIN_15, INPUT);<br />
  pinMode(GPIO_PIN_14, INPUT);<br />
  pinMode(GPIO_PIN_13, INPUT);<br />
  pinMode(GPIO_PIN_12, INPUT);<br />
  pinMode(GPIO_PIN_40, INPUT);<br />
<br />
  Serial.println("GPIO Status Monitoring Started");<br />
}<br />
<br />
void loop() {<br />
  // Read the current state of each GPIO pin<br />
  bool currentState[8];<br />
  currentState[0] = digitalRead(GPIO_PIN_48);<br />
  currentState[1] = digitalRead(GPIO_PIN_47);<br />
  currentState[2] = digitalRead(GPIO_PIN_21);<br />
  currentState[3] = digitalRead(GPIO_PIN_15);<br />
  currentState[4] = digitalRead(GPIO_PIN_14);<br />
  currentState[5] = digitalRead(GPIO_PIN_13);<br />
  currentState[6] = digitalRead(GPIO_PIN_12);<br />
  currentState[7] = digitalRead(GPIO_PIN_40);<br />
<br />
  // Check for changes in GPIO pin states<br />
  for (int i = 0; i &lt; 8; i++) {<br />
    if (currentState[i] != prevState[i]) {<br />
      // Print the pin number and its new state if it has changed<br />
      Serial.print("GPIO ");<br />
      Serial.print(i == 0 ? GPIO_PIN_48 : <br />
                 &nbsp;&nbsp;i == 1 ? GPIO_PIN_47 : <br />
                 &nbsp;&nbsp;i == 2 ? GPIO_PIN_21 : <br />
                 &nbsp;&nbsp;i == 3 ? GPIO_PIN_15 : <br />
                 &nbsp;&nbsp;i == 4 ? GPIO_PIN_14 : <br />
                 &nbsp;&nbsp;i == 5 ? GPIO_PIN_13 : <br />
                 &nbsp;&nbsp;i == 6 ? GPIO_PIN_12 : GPIO_PIN_40);<br />
      Serial.print(" changed to ");<br />
      Serial.println(currentState[i] ? "HIGH" : "LOW");<br />
      // Update the previous state<br />
      prevState[i] = currentState[i];<br />
    }<br />
  }<br />
<br />
  // Delay to avoid flooding the serial monitor<br />
  delay(100); // Adjust the delay as needed<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8572" target="_blank" title="">5-free-gpio-state.zip</a> (Size: 1.05 KB / Downloads: 455)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * GPIO Status Monitoring<br />
 *<br />
 * This program monitors the status (high or low) of multiple GPIO pins on the ESP32-S3.<br />
 * It prints the status of the pins to the serial monitor whenever a change is detected.<br />
 *<br />
 * GPIO Pins Monitored:<br />
 * - GPIO 48<br />
 * - GPIO 47<br />
 * - GPIO 21<br />
 * - GPIO 15<br />
 * - GPIO 14<br />
 * - GPIO 13<br />
 * - GPIO 12<br />
 * - GPIO 40<br />
 *<br />
 * Hardware Requirements:<br />
 * - Connect the pins to appropriate devices or pull them to HIGH/LOW for testing<br />
 */<br />
<br />
#define GPIO_PIN_48 48<br />
#define GPIO_PIN_47 47<br />
#define GPIO_PIN_21 21<br />
#define GPIO_PIN_15 15<br />
#define GPIO_PIN_14 14<br />
#define GPIO_PIN_13 13<br />
#define GPIO_PIN_12 12<br />
#define GPIO_PIN_40 40<br />
<br />
// Store the previous state of the GPIO pins<br />
bool prevState[8] = {false, false, false, false, false, false, false, false};<br />
<br />
void setup() {<br />
  // Initialize serial communication for debugging purposes<br />
  Serial.begin(115200); // Initialize the serial monitor at 115200 baud<br />
  while (!Serial);      // Wait for the serial monitor to open<br />
<br />
  // Initialize GPIO pins as inputs<br />
  pinMode(GPIO_PIN_48, INPUT);<br />
  pinMode(GPIO_PIN_47, INPUT);<br />
  pinMode(GPIO_PIN_21, INPUT);<br />
  pinMode(GPIO_PIN_15, INPUT);<br />
  pinMode(GPIO_PIN_14, INPUT);<br />
  pinMode(GPIO_PIN_13, INPUT);<br />
  pinMode(GPIO_PIN_12, INPUT);<br />
  pinMode(GPIO_PIN_40, INPUT);<br />
<br />
  Serial.println("GPIO Status Monitoring Started");<br />
}<br />
<br />
void loop() {<br />
  // Read the current state of each GPIO pin<br />
  bool currentState[8];<br />
  currentState[0] = digitalRead(GPIO_PIN_48);<br />
  currentState[1] = digitalRead(GPIO_PIN_47);<br />
  currentState[2] = digitalRead(GPIO_PIN_21);<br />
  currentState[3] = digitalRead(GPIO_PIN_15);<br />
  currentState[4] = digitalRead(GPIO_PIN_14);<br />
  currentState[5] = digitalRead(GPIO_PIN_13);<br />
  currentState[6] = digitalRead(GPIO_PIN_12);<br />
  currentState[7] = digitalRead(GPIO_PIN_40);<br />
<br />
  // Check for changes in GPIO pin states<br />
  for (int i = 0; i &lt; 8; i++) {<br />
    if (currentState[i] != prevState[i]) {<br />
      // Print the pin number and its new state if it has changed<br />
      Serial.print("GPIO ");<br />
      Serial.print(i == 0 ? GPIO_PIN_48 : <br />
                 &nbsp;&nbsp;i == 1 ? GPIO_PIN_47 : <br />
                 &nbsp;&nbsp;i == 2 ? GPIO_PIN_21 : <br />
                 &nbsp;&nbsp;i == 3 ? GPIO_PIN_15 : <br />
                 &nbsp;&nbsp;i == 4 ? GPIO_PIN_14 : <br />
                 &nbsp;&nbsp;i == 5 ? GPIO_PIN_13 : <br />
                 &nbsp;&nbsp;i == 6 ? GPIO_PIN_12 : GPIO_PIN_40);<br />
      Serial.print(" changed to ");<br />
      Serial.println(currentState[i] ? "HIGH" : "LOW");<br />
      // Update the previous state<br />
      prevState[i] = currentState[i];<br />
    }<br />
  }<br />
<br />
  // Delay to avoid flooding the serial monitor<br />
  delay(100); // Adjust the delay as needed<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8572" target="_blank" title="">5-free-gpio-state.zip</a> (Size: 1.05 KB / Downloads: 455)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-04 RS485 communication test]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8701</link>
			<pubDate>Thu, 28 Nov 2024 19:44:19 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8701</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * RS485 Communication Test<br />
 *<br />
 * This program is a simple test for RS485 communication using ESP32-S3.<br />
 * It will send a message over RS485 and then read incoming messages.<br />
 * The TXD pin is defined as GPIO 16 and RXD pin is defined as GPIO 17.<br />
 */<br />
<br />
#include &lt;HardwareSerial.h&gt;<br />
<br />
// Define RS485 pins<br />
#define RS485_RXD 17<br />
#define RS485_TXD 16<br />
<br />
// Create a hardware serial object<br />
HardwareSerial rs485Serial(1);<br />
<br />
void setup() {<br />
  // Start serial communication for debugging<br />
  Serial.begin(115200);<br />
  while (!Serial);<br />
<br />
  // Initialize RS485 Serial communication<br />
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);<br />
  <br />
  Serial.println("RS485 Test Start");<br />
}<br />
<br />
void loop() {<br />
  // Send a test message<br />
  rs485Serial.println("Hello from KinCony F16!");<br />
<br />
  // Wait for a short period<br />
  delay(1000);<br />
<br />
  // Check if data is available to read<br />
  if (rs485Serial.available()) {<br />
    String receivedMessage = "";<br />
    while (rs485Serial.available()) {<br />
      char c = rs485Serial.read();<br />
      receivedMessage += c;<br />
    }<br />
    // Print the received message<br />
    Serial.print("Received: ");<br />
    Serial.println(receivedMessage);<br />
  }<br />
<br />
  // Wait before sending the next message<br />
  delay(2000);<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8571" target="_blank" title="">4-RS485-Test.zip</a> (Size: 763 bytes / Downloads: 441)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * RS485 Communication Test<br />
 *<br />
 * This program is a simple test for RS485 communication using ESP32-S3.<br />
 * It will send a message over RS485 and then read incoming messages.<br />
 * The TXD pin is defined as GPIO 16 and RXD pin is defined as GPIO 17.<br />
 */<br />
<br />
#include &lt;HardwareSerial.h&gt;<br />
<br />
// Define RS485 pins<br />
#define RS485_RXD 17<br />
#define RS485_TXD 16<br />
<br />
// Create a hardware serial object<br />
HardwareSerial rs485Serial(1);<br />
<br />
void setup() {<br />
  // Start serial communication for debugging<br />
  Serial.begin(115200);<br />
  while (!Serial);<br />
<br />
  // Initialize RS485 Serial communication<br />
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);<br />
  <br />
  Serial.println("RS485 Test Start");<br />
}<br />
<br />
void loop() {<br />
  // Send a test message<br />
  rs485Serial.println("Hello from KinCony F16!");<br />
<br />
  // Wait for a short period<br />
  delay(1000);<br />
<br />
  // Check if data is available to read<br />
  if (rs485Serial.available()) {<br />
    String receivedMessage = "";<br />
    while (rs485Serial.available()) {<br />
      char c = rs485Serial.read();<br />
      receivedMessage += c;<br />
    }<br />
    // Print the received message<br />
    Serial.print("Received: ");<br />
    Serial.println(receivedMessage);<br />
  }<br />
<br />
  // Wait before sending the next message<br />
  delay(2000);<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8571" target="_blank" title="">4-RS485-Test.zip</a> (Size: 763 bytes / Downloads: 441)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for F32]-03 Read analog input ports value]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8700</link>
			<pubDate>Thu, 28 Nov 2024 19:43:08 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8700</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * Description:<br />
 * This Arduino program reads analog values from four analog input pins (A1, A2, A3, A4)<br />
 * and prints the values to the Serial Monitor. The analog inputs are defined with specific<br />
 * GPIO pins and the program reads the voltage levels from these pins every 2 seconds.<br />
 *<br />
 * Pin Definitions:<br />
 * - A1: GPIO 5<br />
 * - A2: GPIO 7<br />
 * - A3: GPIO 6<br />
 * - A4: GPIO 4<br />
 */<br />
<br />
#define ANALOG_A1 &nbsp;&nbsp;5 &nbsp;&nbsp;// Define GPIO pin for analog input A1<br />
#define ANALOG_A2 &nbsp;&nbsp;7 &nbsp;&nbsp;// Define GPIO pin for analog input A2<br />
#define ANALOG_A3 &nbsp;&nbsp;6 &nbsp;&nbsp;// Define GPIO pin for analog input A3<br />
#define ANALOG_A4 &nbsp;&nbsp;4 &nbsp;&nbsp;// Define GPIO pin for analog input A4<br />
<br />
void setup()<br />
{<br />
    Serial.begin(115200); // Initialize serial communication at 115200 baud rate<br />
    delay(500); // Short delay to allow serial communication to start<br />
<br />
    pinMode(ANALOG_A1, INPUT); // Set GPIO 5 as an input for analog signal A1<br />
    pinMode(ANALOG_A2, INPUT); // Set GPIO 7 as an input for analog signal A2<br />
    pinMode(ANALOG_A3, INPUT); // Set GPIO 6 as an input for analog signal A3<br />
    pinMode(ANALOG_A4, INPUT); // Set GPIO 4 as an input for analog signal A4<br />
}<br />
<br />
void loop()<br />
{<br />
    // Read and print analog values from the defined pins<br />
    Serial.print("A1="); <br />
    Serial.println(analogRead(ANALOG_A1)); // Read and print the value from A1<br />
    Serial.print("A2=");<br />
    Serial.println(analogRead(ANALOG_A2)); // Read and print the value from A2<br />
    Serial.print("A3=");<br />
    Serial.println(analogRead(ANALOG_A3)); // Read and print the value from A3<br />
    Serial.print("A4=");<br />
    Serial.println(analogRead(ANALOG_A4)); // Read and print the value from A4<br />
    <br />
    delay(2000); // Wait for 2 seconds before the next reading<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8570" target="_blank" title="">3-analog-input.zip</a> (Size: 769 bytes / Downloads: 455)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
 * Made by KinCony IoT: https://www.kincony.com<br />
 *<br />
 * Description:<br />
 * This Arduino program reads analog values from four analog input pins (A1, A2, A3, A4)<br />
 * and prints the values to the Serial Monitor. The analog inputs are defined with specific<br />
 * GPIO pins and the program reads the voltage levels from these pins every 2 seconds.<br />
 *<br />
 * Pin Definitions:<br />
 * - A1: GPIO 5<br />
 * - A2: GPIO 7<br />
 * - A3: GPIO 6<br />
 * - A4: GPIO 4<br />
 */<br />
<br />
#define ANALOG_A1 &nbsp;&nbsp;5 &nbsp;&nbsp;// Define GPIO pin for analog input A1<br />
#define ANALOG_A2 &nbsp;&nbsp;7 &nbsp;&nbsp;// Define GPIO pin for analog input A2<br />
#define ANALOG_A3 &nbsp;&nbsp;6 &nbsp;&nbsp;// Define GPIO pin for analog input A3<br />
#define ANALOG_A4 &nbsp;&nbsp;4 &nbsp;&nbsp;// Define GPIO pin for analog input A4<br />
<br />
void setup()<br />
{<br />
    Serial.begin(115200); // Initialize serial communication at 115200 baud rate<br />
    delay(500); // Short delay to allow serial communication to start<br />
<br />
    pinMode(ANALOG_A1, INPUT); // Set GPIO 5 as an input for analog signal A1<br />
    pinMode(ANALOG_A2, INPUT); // Set GPIO 7 as an input for analog signal A2<br />
    pinMode(ANALOG_A3, INPUT); // Set GPIO 6 as an input for analog signal A3<br />
    pinMode(ANALOG_A4, INPUT); // Set GPIO 4 as an input for analog signal A4<br />
}<br />
<br />
void loop()<br />
{<br />
    // Read and print analog values from the defined pins<br />
    Serial.print("A1="); <br />
    Serial.println(analogRead(ANALOG_A1)); // Read and print the value from A1<br />
    Serial.print("A2=");<br />
    Serial.println(analogRead(ANALOG_A2)); // Read and print the value from A2<br />
    Serial.print("A3=");<br />
    Serial.println(analogRead(ANALOG_A3)); // Read and print the value from A3<br />
    Serial.print("A4=");<br />
    Serial.println(analogRead(ANALOG_A4)); // Read and print the value from A4<br />
    <br />
    delay(2000); // Wait for 2 seconds before the next reading<br />
}</code></div></div> arduino ino file download:  <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=8570" target="_blank" title="">3-analog-input.zip</a> (Size: 769 bytes / Downloads: 455)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
	</channel>
</rss>