<?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 - KC868-A6v3]]></title>
		<link>https://www.kincony.com/forum/</link>
		<description><![CDATA[Smart Home Automation Forum - https://www.kincony.com/forum]]></description>
		<pubDate>Sat, 18 Apr 2026 05:56:53 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Can't connect using KCS firmware]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=9053</link>
			<pubDate>Sun, 15 Feb 2026 17:30:20 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=10434">dalora</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=9053</guid>
			<description><![CDATA[I just purchased KC868-A6V3 Board.<br />
On connecting the unit I tried connecting using wifi hotspot.<br />
I did not find the hotspot I was expecting instead a "Hidden network" appeared in Wifi network list.<br />
I was unable to connect to this <br />
I thought that perhaps unit had shipped unconfigured as I purchased from Aliexpress.<br />
I then tried flashing using KCS_A6V3__v3.19.0 firmware but got the same result.<br />
Firmware tool indicated successful installation.<br />
I then tried setting up using ESPhome in HA using your supplied YAML file and that worked OK , unit comes online  , relays are able to be used.<br />
I tried again using KCS firmware but still same result and Hidden network appeared again in Wifi list.<br />
I tried connecting using SSID of ALR-0070077FE024 and passkey supplied in ESPhome YAML file which got me to the message "unable to connect to this network"<br />
I then went back to ESPhome configuration and it works again and appears online , relays work<br />
This proves that the hardware works but I really want to use the Lora functionality to control some water controllers I have.<br />
Also the LCD display has never displayed anything , - why<br />
Any assistance you can supply is much appreciated]]></description>
			<content:encoded><![CDATA[I just purchased KC868-A6V3 Board.<br />
On connecting the unit I tried connecting using wifi hotspot.<br />
I did not find the hotspot I was expecting instead a "Hidden network" appeared in Wifi network list.<br />
I was unable to connect to this <br />
I thought that perhaps unit had shipped unconfigured as I purchased from Aliexpress.<br />
I then tried flashing using KCS_A6V3__v3.19.0 firmware but got the same result.<br />
Firmware tool indicated successful installation.<br />
I then tried setting up using ESPhome in HA using your supplied YAML file and that worked OK , unit comes online  , relays are able to be used.<br />
I tried again using KCS firmware but still same result and Hidden network appeared again in Wifi list.<br />
I tried connecting using SSID of ALR-0070077FE024 and passkey supplied in ESPhome YAML file which got me to the message "unable to connect to this network"<br />
I then went back to ESPhome configuration and it works again and appears online , relays work<br />
This proves that the hardware works but I really want to use the Lora functionality to control some water controllers I have.<br />
Also the LCD display has never displayed anything , - why<br />
Any assistance you can supply is much appreciated]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Using a different OLED]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8450</link>
			<pubDate>Thu, 14 Aug 2025 17:38:01 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9278">1damo1</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8450</guid>
			<description><![CDATA[Good Evening,  hoping someone has done this or knows what I need todo.<br />
<br />
I'm looking to add a larger screen to the A6v3.<br />
<br />
I'm looking to add this type of screen, im having an issue with selecting the appropriate pins on the board &amp; assigning the appropriate pins in my arduino code.<br />
<br />
Thankyou in advance<br />
<br />
Damien]]></description>
			<content:encoded><![CDATA[Good Evening,  hoping someone has done this or knows what I need todo.<br />
<br />
I'm looking to add a larger screen to the A6v3.<br />
<br />
I'm looking to add this type of screen, im having an issue with selecting the appropriate pins on the board &amp; assigning the appropriate pins in my arduino code.<br />
<br />
Thankyou in advance<br />
<br />
Damien]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868 0-5 inputs]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8416</link>
			<pubDate>Mon, 04 Aug 2025 16:30:18 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9210">vincent</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8416</guid>
			<description><![CDATA[I have a Kincony KC868-A6 and I wonder if I could convert the 2 4-20mA inputs to 0-5v DC inputs. <br />
I went trough the documentation (and diagram) and I can’t figure out how to do this. <br />
<a href="https://www.kincony.com/download/KC868-A6-schematic.pdf" target="_blank" rel="noopener" class="mycode_url">https://www.kincony.com/download/KC868-A6-schematic.pdf</a><br />
<br />
I understand that I need to replace two resistance switch "4-20mA" --&gt; "0-5v" type signal but I can't figure out what to do.<br />
Best regards,<br />
Vincent]]></description>
			<content:encoded><![CDATA[I have a Kincony KC868-A6 and I wonder if I could convert the 2 4-20mA inputs to 0-5v DC inputs. <br />
I went trough the documentation (and diagram) and I can’t figure out how to do this. <br />
<a href="https://www.kincony.com/download/KC868-A6-schematic.pdf" target="_blank" rel="noopener" class="mycode_url">https://www.kincony.com/download/KC868-A6-schematic.pdf</a><br />
<br />
I understand that I need to replace two resistance switch "4-20mA" --&gt; "0-5v" type signal but I can't figure out what to do.<br />
Best regards,<br />
Vincent]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How to calculate ADC voltage input?]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8351</link>
			<pubDate>Mon, 28 Jul 2025 19:32:42 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=9143">rrfals</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8351</guid>
			<description><![CDATA[Hi everyone,<br />
<br />
I'm using the KC868-A16- board and its on-board analog input circuit. I've observed a resistive divider (R1=5.1K, R2=10K) connected to an op-amp, which then feeds into the ADC.  Does this on-board op-amp alter the voltage coming from the resistive divider for measurement purposes? Or just for protection? I'm using Vout = Vin * R2/(R1+R2).]]></description>
			<content:encoded><![CDATA[Hi everyone,<br />
<br />
I'm using the KC868-A16- board and its on-board analog input circuit. I've observed a resistive divider (R1=5.1K, R2=10K) connected to an op-amp, which then feeds into the ADC.  Does this on-board op-amp alter the voltage coming from the resistive divider for measurement purposes? Or just for protection? I'm using Vout = Vin * R2/(R1+R2).]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[USB serial not working]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=8139</link>
			<pubDate>Thu, 05 Jun 2025 05:35:17 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=3615">mikesloper</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=8139</guid>
			<description><![CDATA[I just received the A6v3 board but it won't connect to my computer properly. I have to reconnected the cable about 30-40 times before I get a working serial connection. I have tried 5 different usbc and usba cables and it makes no difference. I also tried it on 2 computers using all available usb ports. I have also tried reinstalling all USB drivers. <br />
<br />
I have never had a problem with any ESP32 board including A6v1, A4 or any esp32 dev module including the espressif esp32-s3 devkit module.<br />
<br />
What am I doing wrong or is this board faulty?<br />
<br />
Board was purchased from Kincony controller store on aliexpress.<br />
<br />
<img src="https://i.ibb.co/TBPXf4Vd/Screenshot-2025-06-04-221731.png" loading="lazy"  alt="[Image: Screenshot-2025-06-04-221731.png]" class="mycode_img" />]]></description>
			<content:encoded><![CDATA[I just received the A6v3 board but it won't connect to my computer properly. I have to reconnected the cable about 30-40 times before I get a working serial connection. I have tried 5 different usbc and usba cables and it makes no difference. I also tried it on 2 computers using all available usb ports. I have also tried reinstalling all USB drivers. <br />
<br />
I have never had a problem with any ESP32 board including A6v1, A4 or any esp32 dev module including the espressif esp32-s3 devkit module.<br />
<br />
What am I doing wrong or is this board faulty?<br />
<br />
Board was purchased from Kincony controller store on aliexpress.<br />
<br />
<img src="https://i.ibb.co/TBPXf4Vd/Screenshot-2025-06-04-221731.png" loading="lazy"  alt="[Image: Screenshot-2025-06-04-221731.png]" class="mycode_img" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-12 Read DS18B20 by 1-wire]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7949</link>
			<pubDate>Fri, 18 Apr 2025 13:33:20 +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=7949</guid>
			<description><![CDATA[here is ESP32 DS18B20 arduino library for KC868-A6v3.<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=7437" target="_blank" title="">esp32-ds18b20-main.zip</a> (Size: 6.49 KB / Downloads: 473)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[here is ESP32 DS18B20 arduino library for KC868-A6v3.<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=7437" target="_blank" title="">esp32-ds18b20-main.zip</a> (Size: 6.49 KB / Downloads: 473)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-A6v3 ESPHome yaml for home assistant]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7623</link>
			<pubDate>Sat, 15 Feb 2025 13:43:55 +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=7623</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>esphome:<br />
  name: a6v3<br />
  friendly_name: a6v3<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
<br />
wifi:<br />
  ssid: "KinCony"<br />
  password: "a12345678"<br />
<br />
  # Enable fallback hotspot (captive portal) in case wifi connection fails<br />
  ap:<br />
    ssid: "A6 Fallback Hotspot"<br />
    password: "GLdHSsZr1p96"<br />
<br />
captive_portal:<br />
<br />
i2c:<br />
  sda: 12<br />
  scl: 11<br />
  scan: true<br />
  id: bus_a<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8<br />
    address: 0x24<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for input channel 1-8<br />
    address: 0x22<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: 17<br />
    rx_pin: 18<br />
<br />
  - id: uart_2    #RS232<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 9<br />
    rx_pin: 10<br />
<br />
switch:<br />
  - platform: gpio<br />
    name: "A6v3-output1"<br />
    id: a6v3_output1<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-output2"<br />
    id: a6v3_output2<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output3"<br />
    id: a6v3_output3<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output4"<br />
    id: a6v3_output4<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output5"<br />
    id: a6v3_output5<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output6"<br />
    id: a6v3_output6<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: uart<br />
    uart_id: uart_2<br />
    name: "RS232 Button"<br />
    data: [0x55, 0x66, 0x77, 0x88, 0x99]<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "A6v3-input1"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input2"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input3"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input4"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input5"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input6"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "A6v3-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-W1-io16"<br />
    pin: <br />
      number: 16<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-W1-DW"<br />
    pin: <br />
      number: 0<br />
      inverted: true<br />
<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 4<br />
    name: "A6v3 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: 5<br />
    name: "A6v3 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: "A6v3 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: 7<br />
    name: "A6v3 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<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 A6v3");<br />
<br />
gp8403:<br />
  id: my_gp8403<br />
  voltage: 10V<br />
<br />
output:<br />
  - platform: gp8403<br />
    id: gp8403_output_1<br />
    gp8403_id: my_gp8403<br />
    channel: 0<br />
  - platform: gp8403<br />
    id: gp8403_output_2<br />
    gp8403_id: my_gp8403<br />
    channel: 1<br />
<br />
light:<br />
  - platform: monochromatic<br />
    name: "A6v3-DAC-1"<br />
    output: gp8403_output_1<br />
<br />
  - platform: monochromatic<br />
    name: "A6v3-DAC-2"<br />
    output: gp8403_output_2<br />
<br />
web_server:<br />
  port: 80</code></div></div>esphome yaml file download:<!-- 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=7134" target="_blank" title="">A6v3-HA.txt</a> (Size: 5.11 KB / Downloads: 627)
<!-- 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: a6v3<br />
  friendly_name: a6v3<br />
<br />
esp32:<br />
  board: esp32-s3-devkitc-1<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
<br />
wifi:<br />
  ssid: "KinCony"<br />
  password: "a12345678"<br />
<br />
  # Enable fallback hotspot (captive portal) in case wifi connection fails<br />
  ap:<br />
    ssid: "A6 Fallback Hotspot"<br />
    password: "GLdHSsZr1p96"<br />
<br />
captive_portal:<br />
<br />
i2c:<br />
  sda: 12<br />
  scl: 11<br />
  scan: true<br />
  id: bus_a<br />
<br />
pcf8574:<br />
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8<br />
    address: 0x24<br />
<br />
  - id: 'pcf8574_hub_in_1'  # for input channel 1-8<br />
    address: 0x22<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: 17<br />
    rx_pin: 18<br />
<br />
  - id: uart_2    #RS232<br />
    baud_rate: 9600<br />
    debug:<br />
      direction: BOTH<br />
      dummy_receiver: true<br />
      after:<br />
        timeout: 10ms<br />
    tx_pin: 9<br />
    rx_pin: 10<br />
<br />
switch:<br />
  - platform: gpio<br />
    name: "A6v3-output1"<br />
    id: a6v3_output1<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 0<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-output2"<br />
    id: a6v3_output2<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 1<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output3"<br />
    id: a6v3_output3<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 2<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output4"<br />
    id: a6v3_output4<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 3<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output5"<br />
    id: a6v3_output5<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 4<br />
      mode: OUTPUT<br />
      inverted: true<br />
      <br />
  - platform: gpio<br />
    name: "A6v3-output6"<br />
    id: a6v3_output6<br />
    pin:<br />
      pcf8574: pcf8574_hub_out_1<br />
      number: 5<br />
      mode: OUTPUT<br />
      inverted: true<br />
<br />
  - platform: uart<br />
    uart_id: uart_1<br />
    name: "RS485 Button"<br />
    data: [0x11, 0x22, 0x33, 0x44, 0x55]<br />
<br />
  - platform: uart<br />
    uart_id: uart_2<br />
    name: "RS232 Button"<br />
    data: [0x55, 0x66, 0x77, 0x88, 0x99]<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    name: "A6v3-input1"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 0<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input2"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 1<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input3"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 2<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input4"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 3<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input5"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 4<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-input6"<br />
    pin:<br />
      pcf8574: pcf8574_hub_in_1<br />
      number: 5<br />
      mode: INPUT<br />
      inverted: true<br />
<br />
<br />
##pull-up resistance on PCB<br />
  - platform: gpio<br />
    name: "A6v3-W1-io15"<br />
    pin: <br />
      number: 15<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-W1-io16"<br />
    pin: <br />
      number: 16<br />
      inverted: true<br />
<br />
  - platform: gpio<br />
    name: "A6v3-W1-DW"<br />
    pin: <br />
      number: 0<br />
      inverted: true<br />
<br />
<br />
sensor:<br />
  - platform: adc<br />
    pin: 4<br />
    name: "A6v3 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: 5<br />
    name: "A6v3 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: "A6v3 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: 7<br />
    name: "A6v3 A4 Current"<br />
    update_interval: 5s<br />
    unit_of_measurement: mA<br />
    attenuation: 11db<br />
    filters:<br />
      - multiply: 6.66666666<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 A6v3");<br />
<br />
gp8403:<br />
  id: my_gp8403<br />
  voltage: 10V<br />
<br />
output:<br />
  - platform: gp8403<br />
    id: gp8403_output_1<br />
    gp8403_id: my_gp8403<br />
    channel: 0<br />
  - platform: gp8403<br />
    id: gp8403_output_2<br />
    gp8403_id: my_gp8403<br />
    channel: 1<br />
<br />
light:<br />
  - platform: monochromatic<br />
    name: "A6v3-DAC-1"<br />
    output: gp8403_output_1<br />
<br />
  - platform: monochromatic<br />
    name: "A6v3-DAC-2"<br />
    output: gp8403_output_2<br />
<br />
web_server:<br />
  port: 80</code></div></div>esphome yaml file download:<!-- 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=7134" target="_blank" title="">A6v3-HA.txt</a> (Size: 5.11 KB / Downloads: 627)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-A6v3 ESP32-S3 IO pins define]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7622</link>
			<pubDate>Sat, 15 Feb 2025 13:42:50 +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=7622</guid>
			<description><![CDATA[ANALOG_A1  GPIO4<br />
ANALOG_A2  GPIO5<br />
ANALOG_A3  GPIO6<br />
ANALOG_A4  GPIO7<br />
<br />
1-wire (pull-up resistance on PCB): <br />
1-wire1:GPIO15<br />
1-wire2:GPIO16<br />
<br />
GP8403 DAC i2c address: 0x58<br />
<br />
IIC SDA:GPIO12<br />
IIC SCL:GPIO11<br />
<br />
Input_IIC_address 0x22<br />
Relay_IIC_address 0x24<br />
<br />
RS485 RXD: GPIO18<br />
RS485 TXD: GPIO17<br />
<br />
SPI_Bus: (For LoRA/nRF24L01)<br />
CS: GPIO38<br />
MOSI: GPIO43<br />
MISO: GPIO44<br />
SCK: GPIO39<br />
<br />
LoRA sx1278:<br />
RST:GPIO42<br />
DIO0:GPIO41<br />
<br />
nRF24L01:<br />
CE: GPIO40<br />
<br />
RS232:<br />
TXD:GPIO9<br />
RXD:GPIO10<br />
<br />
free GPIO on PCB (beside ESP32-S3 module)<br />
GPIO8<br />
GPIO13<br />
GPIO14<br />
GPIO21<br />
GPIO47<br />
GPIO48]]></description>
			<content:encoded><![CDATA[ANALOG_A1  GPIO4<br />
ANALOG_A2  GPIO5<br />
ANALOG_A3  GPIO6<br />
ANALOG_A4  GPIO7<br />
<br />
1-wire (pull-up resistance on PCB): <br />
1-wire1:GPIO15<br />
1-wire2:GPIO16<br />
<br />
GP8403 DAC i2c address: 0x58<br />
<br />
IIC SDA:GPIO12<br />
IIC SCL:GPIO11<br />
<br />
Input_IIC_address 0x22<br />
Relay_IIC_address 0x24<br />
<br />
RS485 RXD: GPIO18<br />
RS485 TXD: GPIO17<br />
<br />
SPI_Bus: (For LoRA/nRF24L01)<br />
CS: GPIO38<br />
MOSI: GPIO43<br />
MISO: GPIO44<br />
SCK: GPIO39<br />
<br />
LoRA sx1278:<br />
RST:GPIO42<br />
DIO0:GPIO41<br />
<br />
nRF24L01:<br />
CE: GPIO40<br />
<br />
RS232:<br />
TXD:GPIO9<br />
RXD:GPIO10<br />
<br />
free GPIO on PCB (beside ESP32-S3 module)<br />
GPIO8<br />
GPIO13<br />
GPIO14<br />
GPIO21<br />
GPIO47<br />
GPIO48]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-11 SX1278 LoRA wireless receiver and transmitter]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7381</link>
			<pubDate>Wed, 15 Jan 2025 11:21:57 +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=7381</guid>
			<description><![CDATA[SX1278  Transmitter: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;LoRa.h&gt;<br />
#include &lt;SPI.h&gt;<br />
 <br />
#define ss 38<br />
#define rst 42<br />
#define dio0 41<br />
 <br />
int counter = 0;<br />
 <br />
void setup() <br />
{<br />
  Serial.begin(115200); <br />
  while (!Serial);<br />
  Serial.println("LoRa Sender");<br />
 <br />
  LoRa.setPins(ss, rst, dio0);    //setup LoRa transceiver module<br />
  <br />
  while (!LoRa.begin(433E6))   &nbsp;&nbsp;//433E6 - Asia, 866E6 - Europe, 915E6 - North America<br />
  {<br />
    Serial.println(".");<br />
    delay(500);<br />
  }<br />
  LoRa.setSyncWord(0xA5);<br />
  Serial.println("LoRa Initializing OK!");<br />
}<br />
 <br />
void loop() <br />
{<br />
  Serial.print("Sending packet: ");<br />
  Serial.println(counter);<br />
 <br />
  LoRa.beginPacket(); &nbsp;&nbsp;//Send LoRa packet to receiver<br />
  LoRa.print("hello ");<br />
  LoRa.print(counter);<br />
  LoRa.endPacket();<br />
 <br />
  counter++;<br />
 <br />
  delay(2000);<br />
}</code></div></div><br />
SX1278 Receiver:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;LoRa.h&gt;<br />
#include &lt;SPI.h&gt;<br />
 <br />
#define ss 38<br />
#define rst 42<br />
#define dio0 41<br />
 <br />
void setup() <br />
{<br />
  Serial.begin(115200);<br />
  while (!Serial);<br />
  Serial.println("LoRa Receiver");<br />
 <br />
  LoRa.setPins(ss, rst, dio0);    //setup LoRa transceiver module<br />
 <br />
  while (!LoRa.begin(433E6))   &nbsp;&nbsp;//433E6 - Asia, 866E6 - Europe, 915E6 - North America<br />
  {<br />
    Serial.println(".");<br />
    delay(500);<br />
  }<br />
  LoRa.setSyncWord(0xA5);<br />
  Serial.println("LoRa Initializing OK!");<br />
}<br />
 <br />
void loop() <br />
{<br />
  int packetSize = LoRa.parsePacket();    // try to parse packet<br />
  if (packetSize) <br />
  {<br />
    <br />
    Serial.print("Received packet '");<br />
 <br />
    while (LoRa.available())              // read packet<br />
    {<br />
      String LoRaData = LoRa.readString();<br />
      Serial.print(LoRaData); <br />
    }<br />
    Serial.print("' with RSSI ");       &nbsp;&nbsp;// print RSSI of packet<br />
    Serial.println(LoRa.packetRssi());<br />
  }<br />
}</code></div></div>]]></description>
			<content:encoded><![CDATA[SX1278  Transmitter: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;LoRa.h&gt;<br />
#include &lt;SPI.h&gt;<br />
 <br />
#define ss 38<br />
#define rst 42<br />
#define dio0 41<br />
 <br />
int counter = 0;<br />
 <br />
void setup() <br />
{<br />
  Serial.begin(115200); <br />
  while (!Serial);<br />
  Serial.println("LoRa Sender");<br />
 <br />
  LoRa.setPins(ss, rst, dio0);    //setup LoRa transceiver module<br />
  <br />
  while (!LoRa.begin(433E6))   &nbsp;&nbsp;//433E6 - Asia, 866E6 - Europe, 915E6 - North America<br />
  {<br />
    Serial.println(".");<br />
    delay(500);<br />
  }<br />
  LoRa.setSyncWord(0xA5);<br />
  Serial.println("LoRa Initializing OK!");<br />
}<br />
 <br />
void loop() <br />
{<br />
  Serial.print("Sending packet: ");<br />
  Serial.println(counter);<br />
 <br />
  LoRa.beginPacket(); &nbsp;&nbsp;//Send LoRa packet to receiver<br />
  LoRa.print("hello ");<br />
  LoRa.print(counter);<br />
  LoRa.endPacket();<br />
 <br />
  counter++;<br />
 <br />
  delay(2000);<br />
}</code></div></div><br />
SX1278 Receiver:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;LoRa.h&gt;<br />
#include &lt;SPI.h&gt;<br />
 <br />
#define ss 38<br />
#define rst 42<br />
#define dio0 41<br />
 <br />
void setup() <br />
{<br />
  Serial.begin(115200);<br />
  while (!Serial);<br />
  Serial.println("LoRa Receiver");<br />
 <br />
  LoRa.setPins(ss, rst, dio0);    //setup LoRa transceiver module<br />
 <br />
  while (!LoRa.begin(433E6))   &nbsp;&nbsp;//433E6 - Asia, 866E6 - Europe, 915E6 - North America<br />
  {<br />
    Serial.println(".");<br />
    delay(500);<br />
  }<br />
  LoRa.setSyncWord(0xA5);<br />
  Serial.println("LoRa Initializing OK!");<br />
}<br />
 <br />
void loop() <br />
{<br />
  int packetSize = LoRa.parsePacket();    // try to parse packet<br />
  if (packetSize) <br />
  {<br />
    <br />
    Serial.print("Received packet '");<br />
 <br />
    while (LoRa.available())              // read packet<br />
    {<br />
      String LoRaData = LoRa.readString();<br />
      Serial.print(LoRaData); <br />
    }<br />
    Serial.print("' with RSSI ");       &nbsp;&nbsp;// print RSSI of packet<br />
    Serial.println(LoRa.packetRssi());<br />
  }<br />
}</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-10 nRF24L01 wireless receiver and transmitter]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7380</link>
			<pubDate>Wed, 15 Jan 2025 11:17:44 +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=7380</guid>
			<description><![CDATA[nRF24L01 Transmitter:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;SPI.h&gt;<br />
#include &lt;nRF24L01.h&gt;<br />
#include &lt;RF24.h&gt;<br />
#define CE_PIN 40<br />
#define CSN_PIN 38<br />
 <br />
const uint64_t abc = 0xE8E8F0F0E1LL;<br />
 <br />
RF24 radio(CE_PIN, CSN_PIN);<br />
char data[] = "Hello World, KinCony"; <br />
 <br />
void setup()<br />
 {<br />
   Serial.begin(9600);<br />
   radio.begin();<br />
   radio.openWritingPipe(abc);<br />
 }<br />
 <br />
void loop()<br />
 {<br />
   radio.write( data, sizeof(data) );<br />
 }</code></div></div><br />
nRF24L01 Receiver: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;SPI.h&gt;<br />
#include &lt;nRF24L01.h&gt;<br />
#include &lt;RF24.h&gt;<br />
#define CE_PIN 40<br />
#define CSN_PIN 38<br />
<br />
const uint64_t id = 0xE8E8F0F0E1LL;<br />
<br />
RF24 radio(CE_PIN, CSN_PIN);<br />
<br />
#define SIZE 32            // this is the maximum for this example. (minimum is 1)<br />
char buffer[SIZE + 1];     // for the RX node<br />
uint8_t counter = 0;       // for counting the number of received payloads<br />
 <br />
void setup()<br />
 {<br />
   Serial.begin(9600);<br />
   delay(1000);<br />
   Serial.println("Nrf24L01 Receiver Starting");<br />
   radio.begin();<br />
   radio.openReadingPipe(1,id);<br />
   radio.startListening();;<br />
 }<br />
 <br />
void loop()<br />
 {<br />
    if (radio.available()) {         // is there a payload?<br />
      radio.read(&amp;buffer, SIZE);     // fetch payload from FIFO<br />
      Serial.print("Received:");<br />
      Serial.print(buffer);          // print the payload's value<br />
      Serial.print(" - ");<br />
      Serial.println(counter++);     // print the received counter<br />
    }<br />
 }</code></div></div>]]></description>
			<content:encoded><![CDATA[nRF24L01 Transmitter:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;SPI.h&gt;<br />
#include &lt;nRF24L01.h&gt;<br />
#include &lt;RF24.h&gt;<br />
#define CE_PIN 40<br />
#define CSN_PIN 38<br />
 <br />
const uint64_t abc = 0xE8E8F0F0E1LL;<br />
 <br />
RF24 radio(CE_PIN, CSN_PIN);<br />
char data[] = "Hello World, KinCony"; <br />
 <br />
void setup()<br />
 {<br />
   Serial.begin(9600);<br />
   radio.begin();<br />
   radio.openWritingPipe(abc);<br />
 }<br />
 <br />
void loop()<br />
 {<br />
   radio.write( data, sizeof(data) );<br />
 }</code></div></div><br />
nRF24L01 Receiver: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;SPI.h&gt;<br />
#include &lt;nRF24L01.h&gt;<br />
#include &lt;RF24.h&gt;<br />
#define CE_PIN 40<br />
#define CSN_PIN 38<br />
<br />
const uint64_t id = 0xE8E8F0F0E1LL;<br />
<br />
RF24 radio(CE_PIN, CSN_PIN);<br />
<br />
#define SIZE 32            // this is the maximum for this example. (minimum is 1)<br />
char buffer[SIZE + 1];     // for the RX node<br />
uint8_t counter = 0;       // for counting the number of received payloads<br />
 <br />
void setup()<br />
 {<br />
   Serial.begin(9600);<br />
   delay(1000);<br />
   Serial.println("Nrf24L01 Receiver Starting");<br />
   radio.begin();<br />
   radio.openReadingPipe(1,id);<br />
   radio.startListening();;<br />
 }<br />
 <br />
void loop()<br />
 {<br />
    if (radio.available()) {         // is there a payload?<br />
      radio.read(&amp;buffer, SIZE);     // fetch payload from FIFO<br />
      Serial.print("Received:");<br />
      Serial.print(buffer);          // print the payload's value<br />
      Serial.print(" - ");<br />
      Serial.println(counter++);     // print the received counter<br />
    }<br />
 }</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-09 Dimmer analog output by GP8403]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7379</link>
			<pubDate>Wed, 15 Jan 2025 11:15:36 +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=7379</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 controls the GP8403 DAC I2C chip using an ESP32-S3 board. <br />
 * The program sets the DAC outputs for two channels:<br />
 * - Channel 0 (CH0) outputs 5V.<br />
 * - Channel 1 (CH1) outputs 10V.<br />
 *<br />
 * The I2C communication is handled using the Wire library, and the SDA and SCL pins <br />
 * are custom defined as GPIO12 (SDA) and GPIO11 (SCL).<br />
 *<br />
 * GP8403 I2C address: 0x58<br />
 */<br />
<br />
#include "DFRobot_GP8403.h"<br />
<br />
// Initialize the GP8403 DAC object with the I2C address 0x58<br />
DFRobot_GP8403 dac(&amp;Wire, 0x58);<br />
<br />
void setup() {<br />
  // Start serial communication for debugging purposes<br />
  Serial.begin(115200);<br />
<br />
  // Initialize I2C communication with custom SDA and SCL pins<br />
  Wire.begin(12, 11);  // SDA = GPIO12, SCL = GPIO11<br />
<br />
  // Try to initialize the DAC, retry if initialization fails<br />
  while(dac.begin() != 0) {<br />
    Serial.println("Initialization failed, retrying...");<br />
    delay(1000);  // Wait for 1 second before retrying<br />
  }<br />
<br />
  // If initialization succeeds<br />
  Serial.println("Initialization successful!");<br />
<br />
  // Set the DAC output range to 10V (this setting applies to both channels)<br />
  dac.setDACOutRange(dac.eOutputRange10V);<br />
<br />
  // Set the output for DAC channel 0 to 5V<br />
  // Range for 10V mode is 0-10000, so 5000 represents 5V<br />
  dac.setDACOutVoltage(5000, 0);  // Set CH0 to 5V<br />
  Serial.println("Channel 0 set to 5V");<br />
<br />
  // Set the output for DAC channel 1 to 10V<br />
  dac.setDACOutVoltage(10000, 1);  // Set CH1 to 10V<br />
  Serial.println("Channel 1 set to 10V");<br />
<br />
  // Store the data in the chip's non-volatile memory so it persists after power-off<br />
  dac.store();<br />
  Serial.println("DAC values stored in memory");<br />
}<br />
<br />
void loop() {<br />
  // No need to continuously write the values, the DAC holds the last set value<br />
}</code></div></div> arduino ino file download: <!-- 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=6889" target="_blank" title="">dac-GP8403.zip</a> (Size: 975 bytes / Downloads: 471)
<!-- 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: <!-- 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=6890" target="_blank" title="">dac-GP8403.ino.merged.zip</a> (Size: 189.99 KB / Downloads: 453)
<!-- 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 controls the GP8403 DAC I2C chip using an ESP32-S3 board. <br />
 * The program sets the DAC outputs for two channels:<br />
 * - Channel 0 (CH0) outputs 5V.<br />
 * - Channel 1 (CH1) outputs 10V.<br />
 *<br />
 * The I2C communication is handled using the Wire library, and the SDA and SCL pins <br />
 * are custom defined as GPIO12 (SDA) and GPIO11 (SCL).<br />
 *<br />
 * GP8403 I2C address: 0x58<br />
 */<br />
<br />
#include "DFRobot_GP8403.h"<br />
<br />
// Initialize the GP8403 DAC object with the I2C address 0x58<br />
DFRobot_GP8403 dac(&amp;Wire, 0x58);<br />
<br />
void setup() {<br />
  // Start serial communication for debugging purposes<br />
  Serial.begin(115200);<br />
<br />
  // Initialize I2C communication with custom SDA and SCL pins<br />
  Wire.begin(12, 11);  // SDA = GPIO12, SCL = GPIO11<br />
<br />
  // Try to initialize the DAC, retry if initialization fails<br />
  while(dac.begin() != 0) {<br />
    Serial.println("Initialization failed, retrying...");<br />
    delay(1000);  // Wait for 1 second before retrying<br />
  }<br />
<br />
  // If initialization succeeds<br />
  Serial.println("Initialization successful!");<br />
<br />
  // Set the DAC output range to 10V (this setting applies to both channels)<br />
  dac.setDACOutRange(dac.eOutputRange10V);<br />
<br />
  // Set the output for DAC channel 0 to 5V<br />
  // Range for 10V mode is 0-10000, so 5000 represents 5V<br />
  dac.setDACOutVoltage(5000, 0);  // Set CH0 to 5V<br />
  Serial.println("Channel 0 set to 5V");<br />
<br />
  // Set the output for DAC channel 1 to 10V<br />
  dac.setDACOutVoltage(10000, 1);  // Set CH1 to 10V<br />
  Serial.println("Channel 1 set to 10V");<br />
<br />
  // Store the data in the chip's non-volatile memory so it persists after power-off<br />
  dac.store();<br />
  Serial.println("DAC values stored in memory");<br />
}<br />
<br />
void loop() {<br />
  // No need to continuously write the values, the DAC holds the last set value<br />
}</code></div></div> arduino ino file download: <!-- 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=6889" target="_blank" title="">dac-GP8403.zip</a> (Size: 975 bytes / Downloads: 471)
<!-- 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: <!-- 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=6890" target="_blank" title="">dac-GP8403.ino.merged.zip</a> (Size: 189.99 KB / Downloads: 453)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-08 Print TEXT on SSD1306 OLED displayer]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7378</link>
			<pubDate>Wed, 15 Jan 2025 11:12:57 +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=7378</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*OLED SSD1306 Code for KC868-A6v3*/<br />
<br />
#include &lt;U8g2lib.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  11, 12, U8X8_PIN_NONE);//SCL IO11  SDA  IO12 &nbsp;&nbsp;<br />
<br />
void page1() {<br />
  u8g2.setFont(u8g2_font_timR18_tf);// Font 18<br />
  u8g2.setFontPosTop();<br />
  u8g2.setCursor(5,0);<br />
  u8g2.print("KINCONY");<br />
  u8g2.setFont(u8g2_font_timR12_tf);//Font 12<br />
  u8g2.setCursor(0,40);<br />
  u8g2.print("www.kincony.com");<br />
}<br />
void setup(){<br />
<br />
  u8g2.setI2CAddress(0x3C*2);<br />
  u8g2.begin();<br />
  u8g2.enableUTF8Print();<br />
}<br />
void loop(){<br />
  u8g2.firstPage();<br />
  do<br />
  {<br />
    page1();<br />
  }while(u8g2.nextPage());<br />
<br />
}</code></div></div> arduino ino file download: <!-- 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=6887" target="_blank" title="">oled.zip</a> (Size: 500 bytes / Downloads: 451)
<!-- 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: <!-- 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=6888" target="_blank" title="">oled.ino.merged.zip</a> (Size: 201.21 KB / Downloads: 439)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*OLED SSD1306 Code for KC868-A6v3*/<br />
<br />
#include &lt;U8g2lib.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  11, 12, U8X8_PIN_NONE);//SCL IO11  SDA  IO12 &nbsp;&nbsp;<br />
<br />
void page1() {<br />
  u8g2.setFont(u8g2_font_timR18_tf);// Font 18<br />
  u8g2.setFontPosTop();<br />
  u8g2.setCursor(5,0);<br />
  u8g2.print("KINCONY");<br />
  u8g2.setFont(u8g2_font_timR12_tf);//Font 12<br />
  u8g2.setCursor(0,40);<br />
  u8g2.print("www.kincony.com");<br />
}<br />
void setup(){<br />
<br />
  u8g2.setI2CAddress(0x3C*2);<br />
  u8g2.begin();<br />
  u8g2.enableUTF8Print();<br />
}<br />
void loop(){<br />
  u8g2.firstPage();<br />
  do<br />
  {<br />
    page1();<br />
  }while(u8g2.nextPage());<br />
<br />
}</code></div></div> arduino ino file download: <!-- 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=6887" target="_blank" title="">oled.zip</a> (Size: 500 bytes / Downloads: 451)
<!-- 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: <!-- 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=6888" target="_blank" title="">oled.ino.merged.zip</a> (Size: 201.21 KB / Downloads: 439)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-07 digital INPUT trigger OUTPUT directly]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7377</link>
			<pubDate>Wed, 15 Jan 2025 11:10:00 +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=7377</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
  PCF8574 I2C Digital I/O Expander Example<br />
  Made by KinCony IoT: https://www.kincony.com<br />
<br />
  Description:<br />
  This program demonstrates how to use a PCF8574 I2C expander to read input pins and control relays.<br />
  It reads input states from a PCF8574 module and controls corresponding relays.<br />
  <br />
  The program initializes the input pins as INPUT and output pins as OUTPUT.<br />
  When an input is triggered (LOW), the corresponding relay (output) will activate (LOW).<br />
  It also prevents the relays from briefly activating on startup.<br />
<br />
  Custom I2C pins are defined for SDA and SCL.<br />
<br />
  License:<br />
  You are free to use and modify this code for personal or commercial purposes as long as this<br />
  copyright notice remains intact.<br />
*/<br />
<br />
// Define custom I2C pins for communication<br />
#define SDA_PIN 12    // Set SDA pin for I2C communication<br />
#define SCL_PIN 11 &nbsp;&nbsp;// Set SCL pin for I2C communication<br />
<br />
#include "Arduino.h"<br />
#include "PCF8574.h"<br />
#include &lt;Wire.h&gt;<br />
<br />
// Define I2C addresses for the input and output PCF8574 modules<br />
PCF8574 pcf8574_input(0x22);  // I2C address for the input expander (change according to your setup)<br />
PCF8574 pcf8574_output(0x24); // I2C address for the output expander (change according to your setup)<br />
<br />
void setup() {<br />
  // Start serial communication for debugging purposes<br />
  Serial.begin(115200);<br />
  delay(1000);  // Wait for serial communication to initialize<br />
<br />
  // Initialize I2C and set custom SDA and SCL pins<br />
  Wire.begin(SDA_PIN, SCL_PIN);<br />
<br />
  // Ensure all relay outputs are set to HIGH (deactivated) before initializing the expander<br />
  // This step is to avoid any relay from briefly turning on during setup<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    pcf8574_output.digitalWrite(i, HIGH);<br />
  }<br />
<br />
  // Initialize input pins as INPUT<br />
  pcf8574_input.pinMode(P0, INPUT);<br />
  pcf8574_input.pinMode(P1, INPUT);<br />
  pcf8574_input.pinMode(P2, INPUT);<br />
  pcf8574_input.pinMode(P3, INPUT);<br />
  pcf8574_input.pinMode(P4, INPUT);<br />
  pcf8574_input.pinMode(P5, INPUT);<br />
<br />
  // Initialize output pins as OUTPUT (these control the relays)<br />
  pcf8574_output.pinMode(P0, OUTPUT);<br />
  pcf8574_output.pinMode(P1, OUTPUT);<br />
  pcf8574_output.pinMode(P2, OUTPUT);<br />
  pcf8574_output.pinMode(P3, OUTPUT);<br />
  pcf8574_output.pinMode(P4, OUTPUT);<br />
  pcf8574_output.pinMode(P5, OUTPUT);<br />
<br />
  // Ensure all outputs (relays) are deactivated at the start (set to HIGH)<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    pcf8574_output.digitalWrite(i, HIGH);<br />
  }<br />
<br />
  // Initialize the PCF8574 modules and check for errors<br />
  Serial.print("Init pcf8574_input...");<br />
  if (pcf8574_input.begin()) {<br />
    Serial.println("OK");  // Input expander initialized successfully<br />
  } else {<br />
    Serial.println("KO");  // Input expander initialization failed<br />
  }<br />
<br />
  Serial.print("Init pcf8574_output...");<br />
  if (pcf8574_output.begin()) {<br />
    Serial.println("OK");  // Output expander initialized successfully<br />
  } else {<br />
    Serial.println("KO");  // Output expander initialization failed<br />
  }<br />
}<br />
<br />
void loop() {<br />
  // Read input states from the input expander (PCF8574)<br />
  uint8_t val[6];  // Array to store input states<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    val[i] = pcf8574_input.digitalRead(i);  // Read the state of each input pin<br />
  }<br />
<br />
  // Control relays based on the input states<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    if (val[i] == LOW) {<br />
      // If the input is LOW (triggered), activate the corresponding relay (set to LOW)<br />
      pcf8574_output.digitalWrite(i, LOW);<br />
    } else {<br />
      // If the input is HIGH (not triggered), deactivate the corresponding relay (set to HIGH)<br />
      pcf8574_output.digitalWrite(i, HIGH);<br />
    }<br />
  }<br />
<br />
  delay(300);  // Small delay to prevent rapid state changes<br />
}</code></div></div> arduino ino file download: <!-- 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=6885" target="_blank" title="">Input-trigger-Output.zip</a> (Size: 1.35 KB / Downloads: 468)
<!-- 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: <!-- 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=6886" target="_blank" title="">Input-trigger-Output.ino.merged.zip</a> (Size: 191.31 KB / Downloads: 427)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/*<br />
  PCF8574 I2C Digital I/O Expander Example<br />
  Made by KinCony IoT: https://www.kincony.com<br />
<br />
  Description:<br />
  This program demonstrates how to use a PCF8574 I2C expander to read input pins and control relays.<br />
  It reads input states from a PCF8574 module and controls corresponding relays.<br />
  <br />
  The program initializes the input pins as INPUT and output pins as OUTPUT.<br />
  When an input is triggered (LOW), the corresponding relay (output) will activate (LOW).<br />
  It also prevents the relays from briefly activating on startup.<br />
<br />
  Custom I2C pins are defined for SDA and SCL.<br />
<br />
  License:<br />
  You are free to use and modify this code for personal or commercial purposes as long as this<br />
  copyright notice remains intact.<br />
*/<br />
<br />
// Define custom I2C pins for communication<br />
#define SDA_PIN 12    // Set SDA pin for I2C communication<br />
#define SCL_PIN 11 &nbsp;&nbsp;// Set SCL pin for I2C communication<br />
<br />
#include "Arduino.h"<br />
#include "PCF8574.h"<br />
#include &lt;Wire.h&gt;<br />
<br />
// Define I2C addresses for the input and output PCF8574 modules<br />
PCF8574 pcf8574_input(0x22);  // I2C address for the input expander (change according to your setup)<br />
PCF8574 pcf8574_output(0x24); // I2C address for the output expander (change according to your setup)<br />
<br />
void setup() {<br />
  // Start serial communication for debugging purposes<br />
  Serial.begin(115200);<br />
  delay(1000);  // Wait for serial communication to initialize<br />
<br />
  // Initialize I2C and set custom SDA and SCL pins<br />
  Wire.begin(SDA_PIN, SCL_PIN);<br />
<br />
  // Ensure all relay outputs are set to HIGH (deactivated) before initializing the expander<br />
  // This step is to avoid any relay from briefly turning on during setup<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    pcf8574_output.digitalWrite(i, HIGH);<br />
  }<br />
<br />
  // Initialize input pins as INPUT<br />
  pcf8574_input.pinMode(P0, INPUT);<br />
  pcf8574_input.pinMode(P1, INPUT);<br />
  pcf8574_input.pinMode(P2, INPUT);<br />
  pcf8574_input.pinMode(P3, INPUT);<br />
  pcf8574_input.pinMode(P4, INPUT);<br />
  pcf8574_input.pinMode(P5, INPUT);<br />
<br />
  // Initialize output pins as OUTPUT (these control the relays)<br />
  pcf8574_output.pinMode(P0, OUTPUT);<br />
  pcf8574_output.pinMode(P1, OUTPUT);<br />
  pcf8574_output.pinMode(P2, OUTPUT);<br />
  pcf8574_output.pinMode(P3, OUTPUT);<br />
  pcf8574_output.pinMode(P4, OUTPUT);<br />
  pcf8574_output.pinMode(P5, OUTPUT);<br />
<br />
  // Ensure all outputs (relays) are deactivated at the start (set to HIGH)<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    pcf8574_output.digitalWrite(i, HIGH);<br />
  }<br />
<br />
  // Initialize the PCF8574 modules and check for errors<br />
  Serial.print("Init pcf8574_input...");<br />
  if (pcf8574_input.begin()) {<br />
    Serial.println("OK");  // Input expander initialized successfully<br />
  } else {<br />
    Serial.println("KO");  // Input expander initialization failed<br />
  }<br />
<br />
  Serial.print("Init pcf8574_output...");<br />
  if (pcf8574_output.begin()) {<br />
    Serial.println("OK");  // Output expander initialized successfully<br />
  } else {<br />
    Serial.println("KO");  // Output expander initialization failed<br />
  }<br />
}<br />
<br />
void loop() {<br />
  // Read input states from the input expander (PCF8574)<br />
  uint8_t val[6];  // Array to store input states<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    val[i] = pcf8574_input.digitalRead(i);  // Read the state of each input pin<br />
  }<br />
<br />
  // Control relays based on the input states<br />
  for (int i = 0; i &lt; 6; i++) {<br />
    if (val[i] == LOW) {<br />
      // If the input is LOW (triggered), activate the corresponding relay (set to LOW)<br />
      pcf8574_output.digitalWrite(i, LOW);<br />
    } else {<br />
      // If the input is HIGH (not triggered), deactivate the corresponding relay (set to HIGH)<br />
      pcf8574_output.digitalWrite(i, HIGH);<br />
    }<br />
  }<br />
<br />
  delay(300);  // Small delay to prevent rapid state changes<br />
}</code></div></div> arduino ino file download: <!-- 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=6885" target="_blank" title="">Input-trigger-Output.zip</a> (Size: 1.35 KB / Downloads: 468)
<!-- 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: <!-- 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=6886" target="_blank" title="">Input-trigger-Output.ino.merged.zip</a> (Size: 191.31 KB / Downloads: 427)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-06 how to DS3231 RTC clock]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7376</link>
			<pubDate>Wed, 15 Jan 2025 11:08:04 +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=7376</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 />
*    Set date and time command example: D2024-09-19T11:50:22<br />
*    print current date and time command: current time<br />
*<br />
 *<br />
 * Hardware Connections:<br />
 * - SDA: GPIO 12<br />
 * - SCL: GPIO 11<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;12<br />
#define SCL_PIN &nbsp;&nbsp;11<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: <!-- 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=6883" target="_blank" title="">DS3231-RTC.zip</a> (Size: 1.55 KB / Downloads: 487)
<!-- 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: <!-- 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=6884" target="_blank" title="">DS3231-RTC.ino.merged.zip</a> (Size: 191.07 KB / Downloads: 467)
<!-- 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 />
*    Set date and time command example: D2024-09-19T11:50:22<br />
*    print current date and time command: current time<br />
*<br />
 *<br />
 * Hardware Connections:<br />
 * - SDA: GPIO 12<br />
 * - SCL: GPIO 11<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;12<br />
#define SCL_PIN &nbsp;&nbsp;11<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: <!-- 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=6883" target="_blank" title="">DS3231-RTC.zip</a> (Size: 1.55 KB / Downloads: 487)
<!-- 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: <!-- 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=6884" target="_blank" title="">DS3231-RTC.ino.merged.zip</a> (Size: 191.07 KB / Downloads: 467)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[arduino code examples for A6v3]-05 RS232 communication test]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=7375</link>
			<pubDate>Wed, 15 Jan 2025 11:06: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=7375</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "Arduino.h"<br />
<br />
// Define RS232 pins<br />
#define RS232_TXD 9 // TX pin<br />
#define RS232_RXD 10 // RX pin<br />
<br />
// Define RS232 communication<br />
HardwareSerial RS232(1); // Use UART1<br />
<br />
void setup() {<br />
  // Initialize RS232 serial communication<br />
  RS232.begin(9600, SERIAL_8N1, RS232_RXD, RS232_TXD); // Baud rate 9600, 8 data bits, no parity, 1 stop bit<br />
  Serial.begin(115200); // Debug serial communication<br />
<br />
  Serial.println("RS232 Communication Initialized");<br />
}<br />
<br />
void loop() {<br />
  static unsigned long lastSendTime = 0;<br />
<br />
  // Send a string to RS232 every 5 seconds<br />
  if (millis() - lastSendTime &gt;= 5000) {<br />
    RS232.println("This is KinCony A6v3");<br />
    Serial.println("Sent: This is KinCony A6v3");<br />
    lastSendTime = millis();<br />
  }<br />
<br />
  // Check if data is available from RS232<br />
  while (RS232.available()) {<br />
    String receivedData = RS232.readStringUntil('&#92;n'); // Read data from RS232<br />
    RS232.println(receivedData); // Echo the received data back to RS232<br />
    Serial.println("Received and echoed: " + receivedData); // Print the received data to the debug console<br />
  }<br />
}</code></div></div> arduino ino file download: <!-- 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=6881" target="_blank" title="">RS232.zip</a> (Size: 659 bytes / Downloads: 453)
<!-- 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: <!-- 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=6882" target="_blank" title="">RS232.ino.merged.zip</a> (Size: 184.5 KB / Downloads: 459)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "Arduino.h"<br />
<br />
// Define RS232 pins<br />
#define RS232_TXD 9 // TX pin<br />
#define RS232_RXD 10 // RX pin<br />
<br />
// Define RS232 communication<br />
HardwareSerial RS232(1); // Use UART1<br />
<br />
void setup() {<br />
  // Initialize RS232 serial communication<br />
  RS232.begin(9600, SERIAL_8N1, RS232_RXD, RS232_TXD); // Baud rate 9600, 8 data bits, no parity, 1 stop bit<br />
  Serial.begin(115200); // Debug serial communication<br />
<br />
  Serial.println("RS232 Communication Initialized");<br />
}<br />
<br />
void loop() {<br />
  static unsigned long lastSendTime = 0;<br />
<br />
  // Send a string to RS232 every 5 seconds<br />
  if (millis() - lastSendTime &gt;= 5000) {<br />
    RS232.println("This is KinCony A6v3");<br />
    Serial.println("Sent: This is KinCony A6v3");<br />
    lastSendTime = millis();<br />
  }<br />
<br />
  // Check if data is available from RS232<br />
  while (RS232.available()) {<br />
    String receivedData = RS232.readStringUntil('&#92;n'); // Read data from RS232<br />
    RS232.println(receivedData); // Echo the received data back to RS232<br />
    Serial.println("Received and echoed: " + receivedData); // Print the received data to the debug console<br />
  }<br />
}</code></div></div> arduino ino file download: <!-- 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=6881" target="_blank" title="">RS232.zip</a> (Size: 659 bytes / Downloads: 453)
<!-- 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: <!-- 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=6882" target="_blank" title="">RS232.ino.merged.zip</a> (Size: 184.5 KB / Downloads: 459)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
	</channel>
</rss>