Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 867
» Latest member: antoniomar
» Forum threads: 713
» Forum posts: 2,843

Full Statistics

Online Users
There are currently 74 online users.
» 0 Member(s) | 72 Guest(s)
Bing, Google

Latest Threads
KC868-A8 PCB updated V1.5
Forum: News
Last Post: macek
8 hours ago
» Replies: 13
» Views: 300
New DIY Project Support
Forum: DIY Project
Last Post: ahmedk4444@yahoo.com
Today, 02:47 AM
» Replies: 46
» Views: 1,761
16 channels through espho...
Forum: KC868-A16
Last Post: admin
Yesterday, 10:29 PM
» Replies: 3
» Views: 66
voice module arduino code...
Forum: DIY Project
Last Post: admin
08-07-2022, 12:10 PM
» Replies: 26
» Views: 11,192
ESPHome: RF433 functions?
Forum: KC868-AG
Last Post: admin
08-07-2022, 07:24 AM
» Replies: 3
» Views: 68
HMI display control
Forum: KC868-HxB series Smart Controller
Last Post: admin
08-06-2022, 12:55 AM
» Replies: 1
» Views: 73
KC868-D8
Forum: KC868-HxB series Smart Controller
Last Post: admin
08-06-2022, 12:49 AM
» Replies: 9
» Views: 730
Home Assistant Support
Forum: DIY Project
Last Post: admin
08-05-2022, 01:43 PM
» Replies: 2
» Views: 83
led doesn't light up
Forum: KC868-A16
Last Post: admin
08-05-2022, 05:29 AM
» Replies: 7
» Views: 139
[Arduino IDE demo source ...
Forum: KC868-A128
Last Post: KinCony Support
08-05-2022, 02:13 AM
» Replies: 0
» Views: 48

  16 channels through esphome modbus communication.
Posted by: 2sdaymars - Yesterday, 11:06 AM - Forum: KC868-A16 - Replies (3)

I am currently trying to connect a controller with 16 channels through esphome modbus communication.

https://esphome.io/components/modbus_controller.html

Tried with this example but failed.

uart:
  id: mod_bus
  tx_pin: 17
  rx_pin: 16
  baud_rate: 115200
  stop_bits: 1

Are the tx and rx pin numbers correct?

What part should I edit?
I really need your help.
We are preparing a plant factory, so if this succeeds, we plan to continue ordering 16-channel boards in the future.

to be able to help
Load the controller Modbus sheet.


http://www.koreadigital.com/pages/sensec...load_1.pdf

Print this item

  HMI display control
Posted by: Maq17444 - 08-05-2022, 11:41 PM - Forum: KC868-HxB series Smart Controller - Replies (1)

Hi, 

I'm interesting in controlling all (KC868-H32BS and KC868-E16s etc.) relay's by not only home assistant but with a robust HMI monitor for more reliability and customization; recently I bought KC868-E16s and I noticed that it has a 4 pin Serial interface Rx Tx... which mean that I can control it by UART with the proper HMI display, but also I have a KC868-H32BS & KC868-colb and wondered that could I control it by the HMI by RS485/ RS232 as Master 'if applicable' or there are other ways.


Moreover, I've found the datasheet of the kc868' RS485 protocol but not for RS232!


Note: I'm not an expert in serial communication field.


Thanks

Print this item

  ESPHome: RF433 functions?
Posted by: voltagex - 08-05-2022, 12:37 PM - Forum: KC868-AG - Replies (3)

With the following ESPHome settings:

remote_receiver:
  - id: receiver_ir
    pin:
      number: GPIO23
      inverted: True
    dump: nec

  - id: receiver_rf
    pin:
      number: GPIO25
      inverted: True
    dump: all
    # Settings to optimize recognition of RF devices
    tolerance: 50%
    filter: 250us
    idle: 4ms
    buffer_size: 2kb


How is the RF receiver supposed to work? I'm getting no log output from ESPHome version 2022.6.2 with a blind remote (https://fccid.io/2AGGZMT0201014)

Print this item

  [Arduino IDE demo source code for KC868-A128]--#04--LAN8720 code
Posted by: KinCony Support - 08-05-2022, 02:13 AM - Forum: KC868-A128 - No Replies

[Arduino IDE demo source code for KC868-A128]--#04--LAN8720 code

Code:
#include <ETH.h>
#include <WiFiUdp.h>

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN   18
#define ETH_TYPE       ETH_PHY_LAN8720
#define ETH_CLK_MODE   ETH_CLOCK_GPIO17_OUT

WiFiUDP Udp;                      //Create UDP object
unsigned int localUdpPort = 4196; //local port
IPAddress local_ip(192, 168, 123, 200);
IPAddress gateway(192, 168, 123, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 123, 1);

void setup()
{
  Serial.begin(115200);
  Serial.println();
   
  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); //start with ETH

  // write confir for static IP, gateway,subnet,dns1,dns2
  if (ETH.config(local_ip, gateway, subnet, dns, dns) == false) {
    Serial.println("LAN8720 Configuration failed.");
  }else{Serial.println("LAN8720 Configuration success.");}
 
/* while(!((uint32_t)ETH.localIP())) //wait for IP
  {

  }*/
  Serial.println("Connected");
  Serial.print("IP Address:");
  Serial.println(ETH.localIP());

  Udp.begin(localUdpPort); //begin UDP listener
}

void loop()
{
  int packetSize = Udp.parsePacket(); //get package size
  if (packetSize)                     //if have received data
  {
    char buf[packetSize];
    Udp.read(buf, packetSize); //read current data

    Serial.println();
    Serial.print("Received: ");
    Serial.println(buf);
    Serial.print("From IP: ");
    Serial.println(Udp.remoteIP());
    Serial.print("From Port: ");
    Serial.println(Udp.remotePort());

    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); //ready to send data
    Udp.print("Received: ");   
    Udp.write((const uint8_t*)buf, packetSize); //copy data to sender buffer
    Udp.endPacket();            //send data
  }
}

Print this item

  [Arduino IDE demo source code for KC868-A128]--#03--PCF8575-DO code
Posted by: KinCony Support - 08-05-2022, 02:11 AM - Forum: KC868-A128 - No Replies

[Arduino IDE demo source code for KC868-A128]--#03--PCF8575-DO code

Code:
#include "Arduino.h"
#include "PCF8575.h"

// Set i2c address
PCF8575 pcf8575_R1(0x24,5,16);
PCF8575 pcf8575_R2(0x25,5,16);
PCF8575 pcf8575_R3(0x21,5,16);
PCF8575 pcf8575_R4(0x22,5,16);
PCF8575 pcf8575_R5(0x26,5,16);
PCF8575 pcf8575_R6(0x27,5,16);
PCF8575 pcf8575_R7(0x20,5,16);
PCF8575 pcf8575_R8(0x23,5,16);

unsigned long timeElapsed;
void setup()
{
  Serial.begin(115200);
  pcf8575_R1.begin();
  pcf8575_R2.begin();
  pcf8575_R3.begin();
  pcf8575_R4.begin();
  pcf8575_R5.begin();
  pcf8575_R6.begin();
  pcf8575_R7.begin();
  pcf8575_R8.begin();
 
pcf8575_R1.pinMode(P0,OUTPUT);
pcf8575_R1.pinMode(P1,OUTPUT);
pcf8575_R1.pinMode(P2,OUTPUT);
pcf8575_R1.pinMode(P3,OUTPUT);
pcf8575_R1.pinMode(P4,OUTPUT);
pcf8575_R1.pinMode(P5,OUTPUT);
pcf8575_R1.pinMode(P6,OUTPUT);
pcf8575_R1.pinMode(P7,OUTPUT);
pcf8575_R1.pinMode(P8,OUTPUT);
pcf8575_R1.pinMode(P9,OUTPUT);
pcf8575_R1.pinMode(P10,OUTPUT);
pcf8575_R1.pinMode(P11,OUTPUT);
pcf8575_R1.pinMode(P12,OUTPUT);
pcf8575_R1.pinMode(P13,OUTPUT);
pcf8575_R1.pinMode(P14,OUTPUT);
pcf8575_R1.pinMode(P15,OUTPUT);

pcf8575_R2.pinMode(P0,OUTPUT);
pcf8575_R2.pinMode(P1,OUTPUT);
pcf8575_R2.pinMode(P2,OUTPUT);
pcf8575_R2.pinMode(P3,OUTPUT);
pcf8575_R2.pinMode(P4,OUTPUT);
pcf8575_R2.pinMode(P5,OUTPUT);
pcf8575_R2.pinMode(P6,OUTPUT);
pcf8575_R2.pinMode(P7,OUTPUT);
pcf8575_R2.pinMode(P8,OUTPUT);
pcf8575_R2.pinMode(P9,OUTPUT);
pcf8575_R2.pinMode(P10,OUTPUT);
pcf8575_R2.pinMode(P11,OUTPUT);
pcf8575_R2.pinMode(P12,OUTPUT);
pcf8575_R2.pinMode(P13,OUTPUT);
pcf8575_R2.pinMode(P14,OUTPUT);
pcf8575_R2.pinMode(P15,OUTPUT);

pcf8575_R3.pinMode(P0,OUTPUT);
pcf8575_R3.pinMode(P1,OUTPUT);
pcf8575_R3.pinMode(P2,OUTPUT);
pcf8575_R3.pinMode(P3,OUTPUT);
pcf8575_R3.pinMode(P4,OUTPUT);
pcf8575_R3.pinMode(P5,OUTPUT);
pcf8575_R3.pinMode(P6,OUTPUT);
pcf8575_R3.pinMode(P7,OUTPUT);
pcf8575_R3.pinMode(P8,OUTPUT);
pcf8575_R3.pinMode(P9,OUTPUT);
pcf8575_R3.pinMode(P10,OUTPUT);
pcf8575_R3.pinMode(P11,OUTPUT);
pcf8575_R3.pinMode(P12,OUTPUT);
pcf8575_R3.pinMode(P13,OUTPUT);
pcf8575_R3.pinMode(P14,OUTPUT);
pcf8575_R3.pinMode(P15,OUTPUT);
pcf8575_R4.pinMode(P0,OUTPUT);
pcf8575_R4.pinMode(P1,OUTPUT);
pcf8575_R4.pinMode(P2,OUTPUT);
pcf8575_R4.pinMode(P3,OUTPUT);
pcf8575_R4.pinMode(P4,OUTPUT);
pcf8575_R4.pinMode(P5,OUTPUT);
pcf8575_R4.pinMode(P6,OUTPUT);
pcf8575_R4.pinMode(P7,OUTPUT);
pcf8575_R4.pinMode(P8,OUTPUT);
pcf8575_R4.pinMode(P9,OUTPUT);
pcf8575_R4.pinMode(P10,OUTPUT);
pcf8575_R4.pinMode(P11,OUTPUT);
pcf8575_R4.pinMode(P12,OUTPUT);
pcf8575_R4.pinMode(P13,OUTPUT);
pcf8575_R4.pinMode(P14,OUTPUT);
pcf8575_R4.pinMode(P15,OUTPUT);

pcf8575_R5.pinMode(P0,OUTPUT);
pcf8575_R5.pinMode(P1,OUTPUT);
pcf8575_R5.pinMode(P2,OUTPUT);
pcf8575_R5.pinMode(P3,OUTPUT);
pcf8575_R5.pinMode(P4,OUTPUT);
pcf8575_R5.pinMode(P5,OUTPUT);
pcf8575_R5.pinMode(P6,OUTPUT);
pcf8575_R5.pinMode(P7,OUTPUT);
pcf8575_R5.pinMode(P8,OUTPUT);
pcf8575_R5.pinMode(P9,OUTPUT);
pcf8575_R5.pinMode(P10,OUTPUT);
pcf8575_R5.pinMode(P11,OUTPUT);
pcf8575_R5.pinMode(P12,OUTPUT);
pcf8575_R5.pinMode(P13,OUTPUT);
pcf8575_R5.pinMode(P14,OUTPUT);
pcf8575_R5.pinMode(P15,OUTPUT);

pcf8575_R6.pinMode(P0,OUTPUT);
pcf8575_R6.pinMode(P1,OUTPUT);
pcf8575_R6.pinMode(P2,OUTPUT);
pcf8575_R6.pinMode(P3,OUTPUT);
pcf8575_R6.pinMode(P4,OUTPUT);
pcf8575_R6.pinMode(P5,OUTPUT);
pcf8575_R6.pinMode(P6,OUTPUT);
pcf8575_R6.pinMode(P7,OUTPUT);
pcf8575_R6.pinMode(P8,OUTPUT);
pcf8575_R6.pinMode(P9,OUTPUT);
pcf8575_R6.pinMode(P10,OUTPUT);
pcf8575_R6.pinMode(P11,OUTPUT);
pcf8575_R6.pinMode(P12,OUTPUT);
pcf8575_R6.pinMode(P13,OUTPUT);
pcf8575_R6.pinMode(P14,OUTPUT);
pcf8575_R6.pinMode(P15,OUTPUT);

pcf8575_R7.pinMode(P0,OUTPUT);
pcf8575_R7.pinMode(P1,OUTPUT);
pcf8575_R7.pinMode(P2,OUTPUT);
pcf8575_R7.pinMode(P3,OUTPUT);
pcf8575_R7.pinMode(P4,OUTPUT);
pcf8575_R7.pinMode(P5,OUTPUT);
pcf8575_R7.pinMode(P6,OUTPUT);
pcf8575_R7.pinMode(P7,OUTPUT);
pcf8575_R7.pinMode(P8,OUTPUT);
pcf8575_R7.pinMode(P9,OUTPUT);
pcf8575_R7.pinMode(P10,OUTPUT);
pcf8575_R7.pinMode(P11,OUTPUT);
pcf8575_R7.pinMode(P12,OUTPUT);
pcf8575_R7.pinMode(P13,OUTPUT);
pcf8575_R7.pinMode(P14,OUTPUT);
pcf8575_R7.pinMode(P15,OUTPUT);

pcf8575_R8.pinMode(P0,OUTPUT);
pcf8575_R8.pinMode(P1,OUTPUT);
pcf8575_R8.pinMode(P2,OUTPUT);
pcf8575_R8.pinMode(P3,OUTPUT);
pcf8575_R8.pinMode(P4,OUTPUT);
pcf8575_R8.pinMode(P5,OUTPUT);
pcf8575_R8.pinMode(P6,OUTPUT);
pcf8575_R8.pinMode(P7,OUTPUT);
pcf8575_R8.pinMode(P8,OUTPUT);
pcf8575_R8.pinMode(P9,OUTPUT);
pcf8575_R8.pinMode(P10,OUTPUT);
pcf8575_R8.pinMode(P11,OUTPUT);
pcf8575_R8.pinMode(P12,OUTPUT);
pcf8575_R8.pinMode(P13,OUTPUT);
pcf8575_R8.pinMode(P14,OUTPUT);
pcf8575_R8.pinMode(P15,OUTPUT);




}

void loop()
{
//R1 LOW----------------------
pcf8575_R1.digitalWrite(P0,LOW);
delay(50);
pcf8575_R1.digitalWrite(P1,LOW);
delay(50);
pcf8575_R1.digitalWrite(P2,LOW);
delay(50);
pcf8575_R1.digitalWrite(P3,LOW);
delay(50);
pcf8575_R1.digitalWrite(P4,LOW);
delay(50);
pcf8575_R1.digitalWrite(P5,LOW);
delay(50);
pcf8575_R1.digitalWrite(P6,LOW);
delay(50);
pcf8575_R1.digitalWrite(P7,LOW);
delay(50);
pcf8575_R1.digitalWrite(P8,LOW);
delay(50);
pcf8575_R1.digitalWrite(P9,LOW);
delay(50);
pcf8575_R1.digitalWrite(P10,LOW);
delay(50);
pcf8575_R1.digitalWrite(P11,LOW);
delay(50);
pcf8575_R1.digitalWrite(P12,LOW);
delay(50);
pcf8575_R1.digitalWrite(P13,LOW);
delay(50);
pcf8575_R1.digitalWrite(P14,LOW);
delay(50);
pcf8575_R1.digitalWrite(P15,LOW);
delay(50);

//R2 LOW------------------------
pcf8575_R2.digitalWrite(P0,LOW);
delay(50);
pcf8575_R2.digitalWrite(P1,LOW);
delay(50);
pcf8575_R2.digitalWrite(P2,LOW);
delay(50);
pcf8575_R2.digitalWrite(P3,LOW);
delay(50);
pcf8575_R2.digitalWrite(P4,LOW);
delay(50);
pcf8575_R2.digitalWrite(P5,LOW);
delay(50);
pcf8575_R2.digitalWrite(P6,LOW);
delay(50);
pcf8575_R2.digitalWrite(P7,LOW);
delay(50);
pcf8575_R2.digitalWrite(P8,LOW);
delay(50);
pcf8575_R2.digitalWrite(P9,LOW);
delay(50);
pcf8575_R2.digitalWrite(P10,LOW);
delay(50);
pcf8575_R2.digitalWrite(P11,LOW);
delay(50);
pcf8575_R2.digitalWrite(P12,LOW);
delay(50);
pcf8575_R2.digitalWrite(P13,LOW);
delay(50);
pcf8575_R2.digitalWrite(P14,LOW);
delay(50);
pcf8575_R2.digitalWrite(P15,LOW);
delay(50);

//R3 LOW------------------------
pcf8575_R3.digitalWrite(P0,LOW);
delay(50);
pcf8575_R3.digitalWrite(P1,LOW);
delay(50);
pcf8575_R3.digitalWrite(P2,LOW);
delay(50);
pcf8575_R3.digitalWrite(P3,LOW);
delay(50);
pcf8575_R3.digitalWrite(P4,LOW);
delay(50);
pcf8575_R3.digitalWrite(P5,LOW);
delay(50);
pcf8575_R3.digitalWrite(P6,LOW);
delay(50);
pcf8575_R3.digitalWrite(P7,LOW);
delay(50);
pcf8575_R3.digitalWrite(P8,LOW);
delay(50);
pcf8575_R3.digitalWrite(P9,LOW);
delay(50);
pcf8575_R3.digitalWrite(P10,LOW);
delay(50);
pcf8575_R3.digitalWrite(P11,LOW);
delay(50);
pcf8575_R3.digitalWrite(P12,LOW);
delay(50);
pcf8575_R3.digitalWrite(P13,LOW);
delay(50);
pcf8575_R3.digitalWrite(P14,LOW);
delay(50);
pcf8575_R3.digitalWrite(P15,LOW);
delay(50);

//R4 LOW------------------------
pcf8575_R4.digitalWrite(P0,LOW);
delay(50);
pcf8575_R4.digitalWrite(P1,LOW);
delay(50);
pcf8575_R4.digitalWrite(P2,LOW);
delay(50);
pcf8575_R4.digitalWrite(P3,LOW);
delay(50);
pcf8575_R4.digitalWrite(P4,LOW);
delay(50);
pcf8575_R4.digitalWrite(P5,LOW);
delay(50);
pcf8575_R4.digitalWrite(P6,LOW);
delay(50);
pcf8575_R4.digitalWrite(P7,LOW);
delay(50);
pcf8575_R4.digitalWrite(P8,LOW);
delay(50);
pcf8575_R4.digitalWrite(P9,LOW);
delay(50);
pcf8575_R4.digitalWrite(P10,LOW);
delay(50);
pcf8575_R4.digitalWrite(P11,LOW);
delay(50);
pcf8575_R4.digitalWrite(P12,LOW);
delay(50);
pcf8575_R4.digitalWrite(P13,LOW);
delay(50);
pcf8575_R4.digitalWrite(P14,LOW);
delay(50);
pcf8575_R4.digitalWrite(P15,LOW);
delay(50);

//R5 LOW----------------------
pcf8575_R5.digitalWrite(P0,LOW);
delay(50);
pcf8575_R5.digitalWrite(P1,LOW);
delay(50);
pcf8575_R5.digitalWrite(P2,LOW);
delay(50);
pcf8575_R5.digitalWrite(P3,LOW);
delay(50);
pcf8575_R5.digitalWrite(P4,LOW);
delay(50);
pcf8575_R5.digitalWrite(P5,LOW);
delay(50);
pcf8575_R5.digitalWrite(P6,LOW);
delay(50);
pcf8575_R5.digitalWrite(P7,LOW);
delay(50);
pcf8575_R5.digitalWrite(P8,LOW);
delay(50);
pcf8575_R5.digitalWrite(P9,LOW);
delay(50);
pcf8575_R5.digitalWrite(P10,LOW);
delay(50);
pcf8575_R5.digitalWrite(P11,LOW);
delay(50);
pcf8575_R5.digitalWrite(P12,LOW);
delay(50);
pcf8575_R5.digitalWrite(P13,LOW);
delay(50);
pcf8575_R5.digitalWrite(P14,LOW);
delay(50);
pcf8575_R5.digitalWrite(P15,LOW);
delay(50);

//R6 LOW------------------------
pcf8575_R6.digitalWrite(P0,LOW);
delay(50);
pcf8575_R6.digitalWrite(P1,LOW);
delay(50);
pcf8575_R6.digitalWrite(P2,LOW);
delay(50);
pcf8575_R6.digitalWrite(P3,LOW);
delay(50);
pcf8575_R6.digitalWrite(P4,LOW);
delay(50);
pcf8575_R6.digitalWrite(P5,LOW);
delay(50);
pcf8575_R6.digitalWrite(P6,LOW);
delay(50);
pcf8575_R6.digitalWrite(P7,LOW);
delay(50);
pcf8575_R6.digitalWrite(P8,LOW);
delay(50);
pcf8575_R6.digitalWrite(P9,LOW);
delay(50);
pcf8575_R6.digitalWrite(P10,LOW);
delay(50);
pcf8575_R6.digitalWrite(P11,LOW);
delay(50);
pcf8575_R6.digitalWrite(P12,LOW);
delay(50);
pcf8575_R6.digitalWrite(P13,LOW);
delay(50);
pcf8575_R6.digitalWrite(P14,LOW);
delay(50);
pcf8575_R6.digitalWrite(P15,LOW);
delay(50);

//R7 LOW------------------------
pcf8575_R7.digitalWrite(P0,LOW);
delay(50);
pcf8575_R7.digitalWrite(P1,LOW);
delay(50);
pcf8575_R7.digitalWrite(P2,LOW);
delay(50);
pcf8575_R7.digitalWrite(P3,LOW);
delay(50);
pcf8575_R7.digitalWrite(P4,LOW);
delay(50);
pcf8575_R7.digitalWrite(P5,LOW);
delay(50);
pcf8575_R7.digitalWrite(P6,LOW);
delay(50);
pcf8575_R7.digitalWrite(P7,LOW);
delay(50);
pcf8575_R7.digitalWrite(P8,LOW);
delay(50);
pcf8575_R7.digitalWrite(P9,LOW);
delay(50);
pcf8575_R7.digitalWrite(P10,LOW);
delay(50);
pcf8575_R7.digitalWrite(P11,LOW);
delay(50);
pcf8575_R7.digitalWrite(P12,LOW);
delay(50);
pcf8575_R7.digitalWrite(P13,LOW);
delay(50);
pcf8575_R7.digitalWrite(P14,LOW);
delay(50);
pcf8575_R7.digitalWrite(P15,LOW);
delay(50);

//R8 LOW------------------------
pcf8575_R8.digitalWrite(P0,LOW);
delay(50);
pcf8575_R8.digitalWrite(P1,LOW);
delay(50);
pcf8575_R8.digitalWrite(P2,LOW);
delay(50);
pcf8575_R8.digitalWrite(P3,LOW);
delay(50);
pcf8575_R8.digitalWrite(P4,LOW);
delay(50);
pcf8575_R8.digitalWrite(P5,LOW);
delay(50);
pcf8575_R8.digitalWrite(P6,LOW);
delay(50);
pcf8575_R8.digitalWrite(P7,LOW);
delay(50);
pcf8575_R8.digitalWrite(P8,LOW);
delay(50);
pcf8575_R8.digitalWrite(P9,LOW);
delay(50);
pcf8575_R8.digitalWrite(P10,LOW);
delay(50);
pcf8575_R8.digitalWrite(P11,LOW);
delay(50);
pcf8575_R8.digitalWrite(P12,LOW);
delay(50);
pcf8575_R8.digitalWrite(P13,LOW);
delay(50);
pcf8575_R8.digitalWrite(P14,LOW);
delay(50);
pcf8575_R8.digitalWrite(P15,LOW);
delay(50);




//R1 HIGH-----------------------
pcf8575_R1.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P15,HIGH);
delay(50);

//R3 HIGH------------------------
pcf8575_R2.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P15,HIGH);
delay(50);

//R3 HIGH-----------------------
pcf8575_R3.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P15,HIGH);
delay(50);

//R4 HIGH------------------------
pcf8575_R4.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P15,HIGH);
delay(100);

//R5 HIGH-----------------------
pcf8575_R5.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P15,HIGH);
delay(50);

//R6 HIGH------------------------
pcf8575_R6.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P15,HIGH);
delay(50);

//R7 HIGH-----------------------
pcf8575_R7.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P15,HIGH);
delay(50);

//R8 HIGH------------------------
pcf8575_R8.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P15,HIGH);
delay(100);
}

Print this item

  [Arduino IDE demo source code for KC868-A128]--#02--PCF8575-DI code
Posted by: KinCony Support - 08-05-2022, 02:09 AM - Forum: KC868-A128 - No Replies

[Arduino IDE demo source code for KC868-A128]--#02--PCF8575-DI code

Code:
#include "Arduino.h"
#include "PCF8575.h"

// Set i2c address

PCF8575 pcf8575_IN1(0x24,15,4);
PCF8575 pcf8575_IN2(0x25,15,4);
PCF8575 pcf8575_IN3(0x21,15,4);
PCF8575 pcf8575_IN4(0x22,15,4);
PCF8575 pcf8575_IN5(0x26,15,4);
PCF8575 pcf8575_IN6(0x27,15,4);
PCF8575 pcf8575_IN7(0x20,15,4);
PCF8575 pcf8575_IN8(0x23,15,4);
unsigned long timeElapsed;
void setup()
{
    Serial.begin(115200);
  pcf8575_IN1.begin();
  pcf8575_IN2.begin();
  pcf8575_IN3.begin();
  pcf8575_IN4.begin();
  pcf8575_IN5.begin();
  pcf8575_IN6.begin();
  pcf8575_IN7.begin();
  pcf8575_IN8.begin();

   
  pcf8575_IN1.pinMode(P0,INPUT);
  pcf8575_IN1.pinMode(P1,INPUT);
  pcf8575_IN1.pinMode(P2,INPUT);
  pcf8575_IN1.pinMode(P3,INPUT);
  pcf8575_IN1.pinMode(P4,INPUT);
  pcf8575_IN1.pinMode(P5,INPUT);
  pcf8575_IN1.pinMode(P6,INPUT);
  pcf8575_IN1.pinMode(P7,INPUT);
  pcf8575_IN1.pinMode(P8,INPUT);
  pcf8575_IN1.pinMode(P9,INPUT);
  pcf8575_IN1.pinMode(P10,INPUT);
  pcf8575_IN1.pinMode(P11,INPUT);
  pcf8575_IN1.pinMode(P12,INPUT);
  pcf8575_IN1.pinMode(P13,INPUT);
  pcf8575_IN1.pinMode(P14,INPUT);
  pcf8575_IN1.pinMode(P15,INPUT);

  pcf8575_IN2.pinMode(P0,INPUT);
  pcf8575_IN2.pinMode(P1,INPUT);
  pcf8575_IN2.pinMode(P2,INPUT);
  pcf8575_IN2.pinMode(P3,INPUT);
  pcf8575_IN2.pinMode(P4,INPUT);
  pcf8575_IN2.pinMode(P5,INPUT);
  pcf8575_IN2.pinMode(P6,INPUT);
  pcf8575_IN2.pinMode(P7,INPUT);
  pcf8575_IN2.pinMode(P8,INPUT);
  pcf8575_IN2.pinMode(P9,INPUT);
  pcf8575_IN2.pinMode(P10,INPUT);
  pcf8575_IN2.pinMode(P11,INPUT);
  pcf8575_IN2.pinMode(P12,INPUT);
  pcf8575_IN2.pinMode(P13,INPUT);
  pcf8575_IN2.pinMode(P14,INPUT);
  pcf8575_IN2.pinMode(P15,INPUT);
 
  pcf8575_IN3.pinMode(P0,INPUT);
  pcf8575_IN3.pinMode(P1,INPUT);
  pcf8575_IN3.pinMode(P2,INPUT);
  pcf8575_IN3.pinMode(P3,INPUT);
  pcf8575_IN3.pinMode(P4,INPUT);
  pcf8575_IN3.pinMode(P5,INPUT);
  pcf8575_IN3.pinMode(P6,INPUT);
  pcf8575_IN3.pinMode(P7,INPUT);
  pcf8575_IN3.pinMode(P8,INPUT);
  pcf8575_IN3.pinMode(P9,INPUT);
  pcf8575_IN3.pinMode(P10,INPUT);
  pcf8575_IN3.pinMode(P11,INPUT);
  pcf8575_IN3.pinMode(P12,INPUT);
  pcf8575_IN3.pinMode(P13,INPUT);
  pcf8575_IN3.pinMode(P14,INPUT);
  pcf8575_IN3.pinMode(P15,INPUT);

  pcf8575_IN4.pinMode(P0,INPUT);
  pcf8575_IN4.pinMode(P1,INPUT);
  pcf8575_IN4.pinMode(P2,INPUT);
  pcf8575_IN4.pinMode(P3,INPUT);
  pcf8575_IN4.pinMode(P4,INPUT);
  pcf8575_IN4.pinMode(P5,INPUT);
  pcf8575_IN4.pinMode(P6,INPUT);
  pcf8575_IN4.pinMode(P7,INPUT);
  pcf8575_IN4.pinMode(P8,INPUT);
  pcf8575_IN4.pinMode(P9,INPUT);
  pcf8575_IN4.pinMode(P10,INPUT);
  pcf8575_IN4.pinMode(P11,INPUT);
  pcf8575_IN4.pinMode(P12,INPUT);
  pcf8575_IN4.pinMode(P13,INPUT);
  pcf8575_IN4.pinMode(P14,INPUT);
  pcf8575_IN4.pinMode(P15,INPUT);

  pcf8575_IN5.pinMode(P0,INPUT);
  pcf8575_IN5.pinMode(P1,INPUT);
  pcf8575_IN5.pinMode(P2,INPUT);
  pcf8575_IN5.pinMode(P3,INPUT);
  pcf8575_IN5.pinMode(P4,INPUT);
  pcf8575_IN5.pinMode(P5,INPUT);
  pcf8575_IN5.pinMode(P6,INPUT);
  pcf8575_IN5.pinMode(P7,INPUT);
  pcf8575_IN5.pinMode(P8,INPUT);
  pcf8575_IN5.pinMode(P9,INPUT);
  pcf8575_IN5.pinMode(P10,INPUT);
  pcf8575_IN5.pinMode(P11,INPUT);
  pcf8575_IN5.pinMode(P12,INPUT);
  pcf8575_IN5.pinMode(P13,INPUT);
  pcf8575_IN5.pinMode(P14,INPUT);
  pcf8575_IN5.pinMode(P15,INPUT);

  pcf8575_IN6.pinMode(P0,INPUT);
  pcf8575_IN6.pinMode(P1,INPUT);
  pcf8575_IN6.pinMode(P2,INPUT);
  pcf8575_IN6.pinMode(P3,INPUT);
  pcf8575_IN6.pinMode(P4,INPUT);
  pcf8575_IN6.pinMode(P5,INPUT);
  pcf8575_IN6.pinMode(P6,INPUT);
  pcf8575_IN6.pinMode(P7,INPUT);
  pcf8575_IN6.pinMode(P8,INPUT);
  pcf8575_IN6.pinMode(P9,INPUT);
  pcf8575_IN6.pinMode(P10,INPUT);
  pcf8575_IN6.pinMode(P11,INPUT);
  pcf8575_IN6.pinMode(P12,INPUT);
  pcf8575_IN6.pinMode(P13,INPUT);
  pcf8575_IN6.pinMode(P14,INPUT);
  pcf8575_IN6.pinMode(P15,INPUT);
  pcf8575_IN6.pinMode(P0,INPUT);
  pcf8575_IN6.pinMode(P1,INPUT);
  pcf8575_IN6.pinMode(P2,INPUT);
  pcf8575_IN6.pinMode(P3,INPUT);
  pcf8575_IN6.pinMode(P4,INPUT);
  pcf8575_IN6.pinMode(P5,INPUT);
  pcf8575_IN6.pinMode(P6,INPUT);
  pcf8575_IN6.pinMode(P7,INPUT);
  pcf8575_IN6.pinMode(P8,INPUT);
  pcf8575_IN6.pinMode(P9,INPUT);
  pcf8575_IN6.pinMode(P10,INPUT);
  pcf8575_IN6.pinMode(P11,INPUT);
  pcf8575_IN6.pinMode(P12,INPUT);
  pcf8575_IN6.pinMode(P13,INPUT);
  pcf8575_IN6.pinMode(P14,INPUT);
  pcf8575_IN6.pinMode(P15,INPUT);

  pcf8575_IN7.pinMode(P0,INPUT);
  pcf8575_IN7.pinMode(P1,INPUT);
  pcf8575_IN7.pinMode(P2,INPUT);
  pcf8575_IN7.pinMode(P3,INPUT);
  pcf8575_IN7.pinMode(P4,INPUT);
  pcf8575_IN7.pinMode(P5,INPUT);
  pcf8575_IN7.pinMode(P6,INPUT);
  pcf8575_IN7.pinMode(P7,INPUT);
  pcf8575_IN7.pinMode(P8,INPUT);
  pcf8575_IN7.pinMode(P9,INPUT);
  pcf8575_IN7.pinMode(P10,INPUT);
  pcf8575_IN7.pinMode(P11,INPUT);
  pcf8575_IN7.pinMode(P12,INPUT);
  pcf8575_IN7.pinMode(P13,INPUT);
  pcf8575_IN7.pinMode(P14,INPUT);
  pcf8575_IN7.pinMode(P15,INPUT);

  pcf8575_IN8.pinMode(P0,INPUT);
  pcf8575_IN8.pinMode(P1,INPUT);
  pcf8575_IN8.pinMode(P2,INPUT);
  pcf8575_IN8.pinMode(P3,INPUT);
  pcf8575_IN8.pinMode(P4,INPUT);
  pcf8575_IN8.pinMode(P5,INPUT);
  pcf8575_IN8.pinMode(P6,INPUT);
  pcf8575_IN8.pinMode(P7,INPUT);
  pcf8575_IN8.pinMode(P8,INPUT);
  pcf8575_IN8.pinMode(P9,INPUT);
  pcf8575_IN8.pinMode(P10,INPUT);
  pcf8575_IN8.pinMode(P11,INPUT);
  pcf8575_IN8.pinMode(P12,INPUT);
  pcf8575_IN8.pinMode(P13,INPUT);
  pcf8575_IN8.pinMode(P14,INPUT);
  pcf8575_IN8.pinMode(P15,INPUT);

}

void loop()
{

uint16_t var_rcv = 0;

var_rcv = pcf8575_IN1.digitalReadAll();
if ((pcf8575_IN1.digitalReadAll())!=65535)
  {
    Serial.print("input16-input1 state:");
    Serial.println(var_rcv,BIN);
  }

var_rcv = pcf8575_IN2.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input32-input17 state:");
    Serial.println(var_rcv,BIN);
  }
 
var_rcv = pcf8575_IN3.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input48-input33 state:");
    Serial.println(var_rcv,BIN);
  }

var_rcv = pcf8575_IN4.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input64-input49 state:");
    Serial.println(var_rcv,BIN);
  }

var_rcv = pcf8575_IN5.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input80-input65 state:");
    Serial.println(var_rcv,BIN);
  }   
   
var_rcv = pcf8575_IN6.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input96-input81 state:");
    Serial.println(var_rcv,BIN);
  }   
   
var_rcv = pcf8575_IN7.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input112-input97 state:");
    Serial.println(var_rcv,BIN);
  }   
   
var_rcv = pcf8575_IN8.digitalReadAll();
if (var_rcv!=65535)
  {
    Serial.print("input128-input113 state:");
    Serial.println(var_rcv,BIN);
  }   

   delay(500);
}
   

Print this item

  [Arduino IDE demo source code for KC868-A128]--#01--ADC_INOUT code
Posted by: KinCony Support - 08-05-2022, 02:07 AM - Forum: KC868-A128 - No Replies

[Arduino IDE demo source code for KC868-A128]--#01--ADC_INOUT code

Code:
#include "Arduino.h"

#define ANALOG_A1   39
#define ANALOG_A2   34
#define ANALOG_A3   36
#define ANALOG_A4   35

void setup()
{
    Serial.begin(115200);
    delay(1000);

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  delay(500);
  Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));
  Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));
  Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));
  Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));
}

Print this item

  led doesn't light up
Posted by: 2sdaymars - 08-05-2022, 01:38 AM - Forum: KC868-A16 - Replies (7)

I bought it and used it, but it doesn't work.

I put the code on esphome and turned on the switch, but the led doesn't light up.

i use this code 


esphome:
  name: a16

  platform: ESP32

  board: esp32dev





# Example configuration entry for ESP32

i2c:

  sda: 4

  scl: 5

  scan: true

  id: bus_a



# Example configuration entry

pcf8574:

  - id: 'pcf8574_hub_out_1'  # for output channel 1-8

    address: 0x24



  - id: 'pcf8574_hub_out_2'  # for output channel 9-16

    address: 0x25



  - id: 'pcf8574_hub_in_1'  # for input channel 1-8

    address: 0x21



  - id: 'pcf8574_hub_in_2'  # for input channel 9-16

    address: 0x22



# Individual outputs

switch:

  - platform: gpio

    name: "light1"

    pin:

      pcf8574: pcf8574_hub_out_1

      # Use pin number 0

      number: 0

      # One of INPUT or OUTPUT

      mode: OUTPUT

      inverted: false



  - platform: gpio

    name: "light9"

    pin:

      pcf8574: pcf8574_hub_out_2

      # Use pin number 0

      number: 0

      # One of INPUT or OUTPUT

      mode: OUTPUT

      inverted: false



binary_sensor:

  - platform: gpio

    name: "input1"

    pin:

      pcf8574: pcf8574_hub_in_1

      # Use pin number 0

      number: 0

      # One of INPUT or OUTPUT

      mode: INPUT

      inverted: false



  - platform: gpio

    name: "input9"

    pin:

      pcf8574: pcf8574_hub_in_2

      # Use pin number 0

      number: 0

      # One of INPUT or OUTPUT

      mode: INPUT
      inverted: false

# Enable logging

logger:



# Enable Home Assistant API

api:

  encryption:

    key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"



ota:

  password: "xxxxxxxxxxxxxxxxx"



wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password



  # Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: "xxxxxxxxxxxxxxx"

    password: "xxxxxxxx"



captive_portal:
   

Print this item

  KC868-A128 configure for ESPhome
Posted by: admin - 08-04-2022, 09:47 PM - Forum: KC868-A128 - No Replies


.txt   KC868-A128-ESPHome_PCF8575_Analog.txt (Size: 40.53 KB / Downloads: 9)

esphome:
  name: a128
  platform: ESP32
  board: esp32dev


# Enable logging
logger:

# Enable Home Assistant API
api:


# Example configuration entry
i2c:
  - id: bus_a
    sda: 5
    scl: 16
    scan: true
    frequency: 400kHz
  - id: bus_b
    sda: 15
    scl: 4
    scan: true
    frequency: 400kHz
   

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.198
    gateway: 192.168.1.1
    subnet: 255.255.255.0 

# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-16
    i2c_id: bus_a
    address: 0x24
    pcf8575: true

  - id: 'pcf8574_hub_out_2'  # for output channel 17-32
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_out_3'  # for output channel 33-48
    i2c_id: bus_a
    address: 0x21
    pcf8575: true

  - id: 'pcf8574_hub_out_4'  # for output channel 49-64
    i2c_id: bus_a
    address: 0x22
    pcf8575: true
   
  - id: 'pcf8574_hub_out_5'  # for output channel 65-80
    i2c_id: bus_a
    address: 0x26
    pcf8575: true

  - id: 'pcf8574_hub_out_6'  # for output channel 81-96
    i2c_id: bus_a
    address: 0x27
    pcf8575: true

  - id: 'pcf8574_hub_out_7'  # for output channel 97-112
    i2c_id: bus_a
    address: 0x20
    pcf8575: true

  - id: 'pcf8574_hub_out_8'  # for output channel 113-128
    i2c_id: bus_a
    address: 0x23
    pcf8575: true



  - id: 'pcf8574_hub_in_1'  # for a128-input channel 1-16
    i2c_id: bus_b
    address: 0x24
    pcf8575: true

  - id: 'pcf8574_hub_in_2'  # for a128-input channel 17-32
    i2c_id: bus_b
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_in_3'  # for a128-input channel 33-48
    i2c_id: bus_b
    address: 0x21
    pcf8575: true

  - id: 'pcf8574_hub_in_4'  # for a128-input channel 49-64
    i2c_id: bus_b
    address: 0x22
    pcf8575: true 

  - id: 'pcf8574_hub_in_5'  # for a128-input channel 65-80
    i2c_id: bus_b
    address: 0x26
    pcf8575: true 

  - id: 'pcf8574_hub_in_6'  # for a128-input channel 81-96
    i2c_id: bus_b
    address: 0x27
    pcf8575: true 

  - id: 'pcf8574_hub_in_7'  # for a128-input channel 97-112
    i2c_id: bus_b
    address: 0x20
    pcf8575: true 

  - id: 'pcf8574_hub_in_8'  # for a128-input channel 113-128
    i2c_id: bus_b
    address: 0x23
    pcf8575: true 

   
# Individual outputs
switch:
  - platform: gpio
    name: "a128-light1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true


  - platform: gpio
    name: "a128-light9"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light10"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light11"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light12"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light13"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light14"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light15"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light16"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true
     
     
  - platform: gpio
    name: "a128-light17"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light18"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light19"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light20"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light21"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light22"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light23"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light24"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light25"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light26"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light27"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light28"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light29"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light30"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light31"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light32"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light33"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light34"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light35"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light36"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light37"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light38"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light39"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light40"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light41"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light42"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light43"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light44"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light45"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light46"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light47"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light48"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 15
      mode: OUTPUT
      inverted: true


  - platform: gpio
    name: "a128-light49"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light50"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light51"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light52"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light53"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light54"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light55"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light56"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light57"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light58"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light59"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light60"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light61"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light62"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light63"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light64"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light65"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light66"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light67"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light68"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light69"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light70"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light71"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light72"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light73"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light74"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light75"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light76"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light77"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light78"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light79"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light80"
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light81"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light82"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light83"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light84"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light85"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light86"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light87"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light88"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light89"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light90"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light91"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light92"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light93"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light94"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light95"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light96"
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 15
      mode: OUTPUT
      inverted: true     
     
  - platform: gpio
    name: "a128-light97"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light98"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light99"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light100"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light101"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light102"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light103"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light104"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light105"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light106"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light107"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light108"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light109"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light110"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light111"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light112"
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light113"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light114"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light115"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light116"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light117"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light118"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light119"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light120"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light121"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light122"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light123"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light124"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 11
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a128-light125"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light126"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light127"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light128"
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 15
      mode: OUTPUT
      inverted: true

     
# Individual inputs
binary_sensor:
  - platform: gpio
    name: "a128-input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "a128-input9"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true
     
     
  - platform: gpio
    name: "a128-input17"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input18"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input19"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input20"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input21"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input22"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input23"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input24"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input25"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input26"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input27"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input28"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input29"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input30"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input31"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input32"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 15
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "a128-input33"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input34"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input35"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input36"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input37"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input38"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input39"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input40"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input41"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input42"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input43"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input44"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input45"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input46"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input47"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input48"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 15
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "a128-input49"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input50"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input51"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input52"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input53"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input54"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input55"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input56"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input57"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input58"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input59"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input60"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input61"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input62"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input63"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input64"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 15
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "a128-input65"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input66"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input67"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input68"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input69"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input70"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input71"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input72"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input73"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input74"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input75"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input76"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input77"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input78"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input79"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input80"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 15
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "a128-input81"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input82"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input83"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input84"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input85"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input86"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input87"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input88"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input89"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input90"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input91"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input92"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input93"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input94"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input95"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input96"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 15
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input97"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input98"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input99"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input100"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input101"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input102"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input103"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input104"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input105"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input106"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input107"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input108"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input109"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input110"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input111"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input112"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 15
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input113"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input114"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input115"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input116"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input117"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input118"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input119"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input120"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input121"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input122"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input123"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input124"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 11
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "a128-input125"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input126"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input127"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "a128-input128"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 15
      mode: INPUT
      inverted: true

Print this item

  KC868-A128 ESP32 I/O pin define
Posted by: admin - 08-04-2022, 09:46 PM - Forum: KC868-A128 - No Replies

#define ANALOG_A1  GPIO39
#define ANALOG_A2  GPIO34
#define ANALOG_A3  GPIO36
#define ANALOG_A4  GPIO35

IIC Bus-1:A

SDA-A:GPIO5
SCL-A:GPIO16


PCF8575:U144 (relay1-16): 100 100 = 0x24
PCF8575:U146 (relay17-32): 100 101 = 0x25
PCF8575:U148 (relay33-48): 100 001 = 0x21
PCF8575:U150 (relay49-64): 100 010 = 0x22
PCF8575:U280 (relay65-80): 100 110 = 0x26
PCF8575:U282 (relay81-96): 100 111 = 0x27
PCF8575:U284 (relay97-112): 100 000 = 0x20
PCF8575:U286 (relay113-128): 100 011 = 0x23

IIC Bus-2:B
SDA-B:GPIO15
SCL-B:GPIO4

PCF8575:U143 (DI1-16): 100 100 = 0x24
PCF8575:U145 (DI17-32): 100 101 = 0x25
PCF8575:U147 (DI33-48): 100 001 = 0x21
PCF8575:U149 (DI49-64): 100 010 = 0x22
PCF8575:U279 (DI65-80): 100 110 = 0x26
PCF8575:U281 (DI81-96): 100 111 = 0x27
PCF8575:U283 (DI97-112): 100 000 = 0x20
PCF8575:U285 (DI113-128): 100 011 = 0x23

-----------------

Ethernet (LAN8720) I/O define:

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN  18
#define ETH_TYPE      ETH_PHY_LAN8720
#define ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT

--------------------

RS485:
RXD:GPIO13
TXD:GPIO14

Extend serial port (3.3v TTL level):
RXD:GPIO32
TXD:GPIO33

Print this item