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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,431
» Latest member: mshomsey
» Forum threads: 3,695
» Forum posts: 19,015

Full Statistics

Online Users
There are currently 51 online users.
» 0 Member(s) | 35 Guest(s)
AhrefsBot, Amazonbot, Bing, Bytespider, Crawl, PetalBot, bot

Latest Threads
Voltage wrong
Forum: N30
Last Post: Painy
4 hours ago
» Replies: 0
» Views: 13
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: Michel.nadin
8 hours ago
» Replies: 16
» Views: 596
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:05 AM
» Replies: 0
» Views: 4
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:05 AM
» Replies: 0
» Views: 2
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:04 AM
» Replies: 0
» Views: 6
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:04 AM
» Replies: 0
» Views: 3
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:02 AM
» Replies: 0
» Views: 3
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:02 AM
» Replies: 0
» Views: 2
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:01 AM
» Replies: 0
» Views: 5
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:01 AM
» Replies: 0
» Views: 4

  [arduino code examples for F4]-03 Read analog input ports value
Posted by: admin - 10-01-2024, 04:43 AM - Forum: F4 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads analog values from four analog input pins (A1, A2, A3, A4)
* and prints the values to the Serial Monitor. The analog inputs are defined with specific
* GPIO pins and the program reads the voltage levels from these pins every 2 seconds.
*
* Pin Definitions:
* - A1: GPIO 5
* - A2: GPIO 7
* - A3: GPIO 6
* - A4: GPIO 4
*/

#define ANALOG_A1   5   // Define GPIO pin for analog input A1
#define ANALOG_A2   7   // Define GPIO pin for analog input A2
#define ANALOG_A3   6   // Define GPIO pin for analog input A3
#define ANALOG_A4   4   // Define GPIO pin for analog input A4

void setup()
{
    Serial.begin(115200); // Initialize serial communication at 115200 baud rate
    delay(500); // Short delay to allow serial communication to start

    pinMode(ANALOG_A1, INPUT); // Set GPIO 5 as an input for analog signal A1
    pinMode(ANALOG_A2, INPUT); // Set GPIO 7 as an input for analog signal A2
    pinMode(ANALOG_A3, INPUT); // Set GPIO 6 as an input for analog signal A3
    pinMode(ANALOG_A4, INPUT); // Set GPIO 4 as an input for analog signal A4
}

void loop()
{
    // Read and print analog values from the defined pins
    Serial.print("A1=");
    Serial.println(analogRead(ANALOG_A1)); // Read and print the value from A1
    Serial.print("A2=");
    Serial.println(analogRead(ANALOG_A2)); // Read and print the value from A2
    Serial.print("A3=");
    Serial.println(analogRead(ANALOG_A3)); // Read and print the value from A3
    Serial.print("A4=");
    Serial.println(analogRead(ANALOG_A4)); // Read and print the value from A4
   
    delay(2000); // Wait for 2 seconds before the next reading
}
arduino ino file download: 
.zip   3-analog-input.zip (Size: 769 bytes / Downloads: 426)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   3-analog-input.ino.merged.zip (Size: 182.45 KB / Downloads: 402)

Print this item

  [arduino code examples for F16]-02 Read digital input ports state
Posted by: admin - 10-01-2024, 04:41 AM - Forum: F16 - Replies (2)

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads the state of a 16-channel PCF8575 I/O expander
* and prints the state of all input pins to the Serial Monitor. The state of
* each pin is represented as a bit in a 16-bit value, where each bit corresponds
* to an input pin. The program prints the input state in binary format.
*
* Pin Definitions:
* - SDA: GPIO 21
* - SCL: GPIO 22
* - PCF8575 I2C Address: 0x24
*/

#include "Arduino.h"
#include "PCF8575.h"

// Define I2C pins
#define I2C_SDA 8  // Define SDA pin
#define I2C_SCL 18  // Define SCL pin

// Set I2C address
PCF8575 pcf8575_IN1(0x24); // The I2C address of the PCF8575

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

    // Initialize I2C communication
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins

    pcf8575_IN1.begin(); // Initialize the PCF8575

    Serial.println("KinCony F16 16 channel input state 0:ON  1:OFF");
}

void loop() {
    uint16_t state = 0;

    // Read the state of each pin (assuming 16 pins)
    for (int pin = 0; pin < 16; pin++) {
        if (pcf8575_IN1.read(pin)) {
            state |= (1 << pin); // Set the bit for the active pin
        }
    }

    Serial.print("Input state: ");
    Serial.println(state, BIN); // Print the state of inputs in binary

    delay(500); // Delay 500ms
}
arduino ino file download:
.zip   2-digital-input.zip (Size: 839 bytes / Downloads: 435)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 
.zip   2-digital-input.ino.merged.zip (Size: 187.5 KB / Downloads: 412)

Print this item

  [arduino code examples for F16]-01 Turn ON/OFF relay
Posted by: admin - 10-01-2024, 04:40 AM - Forum: F16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program controls a 16-channel relay board via a PCF8575 I/O expander.
* It sequentially turns on each relay and then turns them off in a loop.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
*
* Delay Time:
* - 200 milliseconds between switching relays
*/

#include <Wire.h>        // Include the Wire library for I2C communication
#include <PCF8575.h>     // Include the PCF8575 library to control the I/O expander

#define SDA 8            // Define the SDA pin
#define SCL 18           // Define the SCL pin
#define DELAY_TIME 200   // Define the delay time in milliseconds

// Set I2C address of the PCF8575 module
#define I2C_ADDRESS 0x25 // I2C address of the PCF8575 module

PCF8575 pcf8575_R1(I2C_ADDRESS); // Create a PCF8575 object with the specified I2C address

void setup() {
  // Initialize I2C communication
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)
 
  // Initialize serial communication for debugging (optional)
  Serial.begin(115200);
  Serial.println("PCF8575 Relay Control: Starting...");

  // Initialize the PCF8575 module
  pcf8575_R1.begin();

  // Turn off all relays initially (set all pins HIGH)
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, HIGH); // Set all relays to OFF (assuming HIGH means OFF for relays)
  }
}

void loop() {
  // Sequentially turn on each relay
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, LOW);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // Sequentially turn off each relay
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }
}
arduino ino file download:
.zip   1-relay.zip (Size: 925 bytes / Downloads: 410)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   1-relay.ino.merged.zip (Size: 187.22 KB / Downloads: 407)

Print this item

  F16 ESPHome yaml for home assistant with tuya
Posted by: admin - 10-01-2024, 04:38 AM - Forum: F16 - Replies (8)

Code:
esphome:
  name: f16
  friendly_name: f16
  platformio_options:
    board_build.extra_flags:
      # WIFI_CONTROL_SELF_MODE = 0
      # WIFI_CONTROL_SELF_MODE = 1
      - "-DWIFI_CONTROL_SELF_MODE=1"
esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
   

external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu
      ref: v1.3.0

# Enable logging

  # hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
  encryption:
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO43
  miso_pin: GPIO44
  cs_pin: GPIO41
  interrupt_pin: GPIO2
  reset_pin: GPIO1

i2c:
   - id: bus_a
     sda: 8
     scl: 18
     scan: true
     frequency: 400kHz

pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-16
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

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

uart:
  - id: uart_1    #RS485
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 16
    rx_pin: 17

  - id: tuya_mcu_uart
    tx_pin: GPIO39
    rx_pin: GPIO38
    baud_rate: 9600

tuya_wifi_mcu:
  # tuya mcu product id
  product_id: chmzlgjpadpqxdko
  uart_id: tuya_mcu_uart
  wifi_reset_pin: 28
  wifi_led_pin: 16

switch:
  - platform: uart
    uart_id: uart_1
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: gpio
    name: "f16-output01"
    id: "f16_output01"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output1-tuya
    dp_id: 1
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output01"

  - platform: gpio
    name: "f16-output02"
    id: "f16_output02"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output2-tuya
    dp_id: 2
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output02"

  - platform: gpio
    name: "f16-output03"
    id: "f16_output03"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output3-tuya
    dp_id: 3
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output03"

  - platform: gpio
    name: "f16-output04"
    id: "f16_output04"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output4-tuya
    dp_id: 4
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output04"

  - platform: gpio
    name: "f16-output05"
    id: "f16_output05"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output5-tuya
    dp_id: 5
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output05"

  - platform: gpio
    name: "f16-output06"
    id: "f16_output06"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output6-tuya
    dp_id: 6
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output06"

  - platform: gpio
    name: "f16-output07"
    id: "f16_output07"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output7-tuya
    dp_id: 101
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output07"

  - platform: gpio
    name: "f16-output08"
    id: "f16_output08"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output8-tuya
    dp_id: 102
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output08"

  - platform: gpio
    name: "f16-output09"
    id: "f16_output09"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output9-tuya
    dp_id: 103
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output09"

  - platform: gpio
    name: "f16-output10"
    id: "f16_output10"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output10-tuya
    dp_id: 104
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output10"

  - platform: gpio
    name: "f16-output11"
    id: "f16_output11"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output11-tuya
    dp_id: 105
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output11"

  - platform: gpio
    name: "f16-output12"
    id: "f16_output12"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output12-tuya
    dp_id: 106
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output12"

  - platform: gpio
    name: "f16-output13"
    id: "f16_output13"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output13-tuya
    dp_id: 107
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output13"

  - platform: gpio
    name: "f16-output14"
    id: "f16_output14"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output14-tuya
    dp_id: 108
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output14"

  - platform: gpio
    name: "f16-output15"
    id: "f16_output15"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output15-tuya
    dp_id: 109
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output15"

  - platform: gpio
    name: "f16-output16"
    id: "f16_output16"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-output16-tuya
    dp_id: 110
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "f16_output16"

binary_sensor:
  - platform: gpio
    name: "f16-input01"
    id: "f16_input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input1-tuya
    dp_id: 111
    bind_binary_sensor_id: f16_input01
    internal: true

  - platform: gpio
    name: "f16-input02"
    id: "f16_input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input2-tuya
    dp_id: 112
    bind_binary_sensor_id: f16_input02
    internal: true

  - platform: gpio
    name: "f16-input03"
    id: "f16_input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input3-tuya
    dp_id: 113
    bind_binary_sensor_id: f16_input03
    internal: true

  - platform: gpio
    name: "f16-input04"
    id: "f16_input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input4-tuya
    dp_id: 114
    bind_binary_sensor_id: f16_input04
    internal: true

  - platform: gpio
    name: "f16-input05"
    id: "f16_input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input5-tuya
    dp_id: 115
    bind_binary_sensor_id: f16_input05
    internal: true

  - platform: gpio
    name: "f16-input06"
    id: "f16_input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input6-tuya
    dp_id: 116
    bind_binary_sensor_id: f16_input06
    internal: true

  - platform: gpio
    name: "f16-input07"
    id: "f16_input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input7-tuya
    dp_id: 117
    bind_binary_sensor_id: f16_input07
    internal: true

  - platform: gpio
    name: "f16-input08"
    id: "f16_input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input8-tuya
    dp_id: 118
    bind_binary_sensor_id: f16_input08
    internal: true

  - platform: gpio
    name: "f16-input09"
    id: "f16_input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input9-tuya
    dp_id: 119
    bind_binary_sensor_id: f16_input09
    internal: true

  - platform: gpio
    name: "f16-input10"
    id: "f16_input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input10-tuya
    dp_id: 120
    bind_binary_sensor_id: f16_input10
    internal: true

  - platform: gpio
    name: "f16-input11"
    id: "f16_input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input11-tuya
    dp_id: 121
    bind_binary_sensor_id: f16_input11
    internal: true

  - platform: gpio
    name: "f16-input12"
    id: "f16_input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input12-tuya
    dp_id: 122
    bind_binary_sensor_id: f16_input12
    internal: true

  - platform: gpio
    name: "f16-input13"
    id: "f16_input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input13-tuya
    dp_id: 123
    bind_binary_sensor_id: f16_input13
    internal: true

  - platform: gpio
    name: "f16-input14"
    id: "f16_input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input14-tuya
    dp_id: 124
    bind_binary_sensor_id: f16_input14
    internal: true

  - platform: gpio
    name: "f16-input15"
    id: "f16_input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input15-tuya
    dp_id: 125
    bind_binary_sensor_id: f16_input15
    internal: true

  - platform: gpio
    name: "f16-input16"
    id: "f16_input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: f16-input16-tuya
    dp_id: 126
    bind_binary_sensor_id: f16_input16
    internal: true

##pull-up resistance on PCB
  - platform: gpio
    name: "f16-W1-io48"
    pin:
      number: 48
      inverted: true

  - platform: gpio
    name: "f16-W1-io47"
    pin:
      number: 47
      inverted: true

  - platform: gpio
    name: "f16-W1-io21"
    pin:
      number: 21
      inverted: true

  - platform: gpio
    name: "f16-W1-io15"
    pin:
      number: 15
      inverted: true
## without resistance on PCB
  - platform: gpio
    name: "f16-W1-io13"
    pin:
      number: 13
      inverted: false

  - platform: gpio
    name: "f16-W1-io14"
    pin:
      number: 14
      inverted:  false

  - platform: gpio
    name: "f16-433M"
    pin:
      number: 40
      inverted:  false

sensor:
  - platform: adc
    pin: 5
    name: "F16 A1 Voltage"
    update_interval: 5s
    attenuation: 11db
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 7
    name: "F16 A2 Voltage"
    update_interval: 5s
    attenuation: 11db
    filters:
      # - multiply: 1.51515
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 6
    name: "F16 A3 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 4
    name: "F16 A4 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

web_server:
  port: 80

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

display:
  - platform: ssd1306_i2c
    i2c_id: bus_a
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "KinCony F16");
download yaml file:
.txt   F16-HA.txt (Size: 14.19 KB / Downloads: 504)

Print this item

  F16 ESP32-S3 IO pins define
Posted by: admin - 10-01-2024, 04:36 AM - Forum: F16 - No Replies

ANALOG_A1(0-5v)    GPIO5
ANALOG_A2(0-5v)    GPIO7
ANALOG_A3(4-20mA)  GPIO6
ANALOG_A4(4-20mA)  GPIO4

IIC SDA:GPIO8
IIC SCL:GPIO18

PCF8575:U27 (relay1-16) i2c address:0x25
PCF8575:U23 (DI1-16) i2c address:0x24

RF433MHz wireless receiver: GPIO40
------------------------

Ethernet (W5500) I/O define:

clk_pin: GPIO42
mosi_pin: GPIO43
miso_pin: GPIO44
cs_pin: GPIO41

interrupt_pin: GPIO2
reset_pin: GPIO1

--------------------
RS485:
RXD:GPIO17
TXD:GPIO16
--------------------
Tuya module:
RXD:GPIO38
TXD:GPIO39

Tuya network button: Tuya module's P28
Tuya network LED: Tuya module's P16

---------------------
1-wire (pull-up resistance on PCB):
1-wire1:GPIO48
1-wire2:GPIO47
1-wire3:GPIO21
1-wire4:GPIO15

1-wire (without resistance on PCB):
1-wire1:GPIO13
1-wire2:GPIO14
------------------------
SD Card:
SPI-MOSI:GPIO10
SPI-SCK:GPIO11
SPI-MISO:GPIO12
SPI-CS:GPIO9
------------------------
24C02 EPROM i2c address: 0x50
DS3231 RTC i2c address: 0x68
SSD1306 display: i2c address:0x3c

Print this item

  Error rs232 no funciona
Posted by: sistemasyusa - 10-01-2024, 02:16 AM - Forum: KC868-A6 - Replies (3)

Buen día 


norte puedo hacer funcionar el puerto serie rs232, algún codigo de ejemplo , anexo el hardware que uso con un Arduino



Attached Files Thumbnail(s)
   
Print this item

  Conectar Arduino nano y kc868
Posted by: sistemasyusa - 10-01-2024, 12:48 AM - Forum: KC868-A6 - Replies (1)

Buen día 

Quiero preguntar si es posible conectar un Arduino nano directo a alguno de los pines de kc868 para comunicación serial

Print this item

  Kc868 Read Pwm input
Posted by: huntleight - 09-30-2024, 09:42 PM - Forum: KC868-A6 - Replies (7)

How to read pwm input with pcf8574 ?

Print this item

  KC868-A16 into Home assistant via MQTT
Posted by: Ugeo - 09-30-2024, 02:25 PM - Forum: KC868-A16 - Replies (11)

Please help us create the integration of KC868-A16 into Home assistant via MQTT.
Home assistant does not see data from KC868-A16
   

Print this item

  KC868-A8 Ethernet Problem
Posted by: Namil Heo - 09-30-2024, 01:11 PM - Forum: KC868-A8 - No Replies

Hello, i have a KC868-A8 Board connected with ethernet cable but the port suddenly stopped working.

# 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

IPAddress local_ip(192, 168, 0, 144);
IPAddress gateway(192, 168, 0, 254);
IPAddress subnet(255, 255, 255, 0);

  ETH.begin(ETH_TYPE, ETH_ADDR, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_POWER_PIN, ETH_CLK_MODE);
  if (ETH.config(local_ip, gateway, subnet, dns, dns) == false) {
    Serial.println("EtherNet failed.");
  }else{Serial.println("EtherNet Success.");}

  Serial.println("Connected");
  Serial.print("IP Address:");
  Serial.println(ETH.localIP());
  delay(500);

Print this item