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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,850
» Latest member: gg07
» Forum threads: 3,873
» Forum posts: 19,765

Full Statistics

Online Users
There are currently 36 online users.
» 0 Member(s) | 21 Guest(s)
AhrefsBot, Amazonbot, Applebot, PetalBot, Sogou web, Yandex, bot

Latest Threads
N60 wire case diagram for...
Forum: N60
Last Post: admin
9 hours ago
» Replies: 0
» Views: 3
N60 wire case diagram for...
Forum: N60
Last Post: admin
9 hours ago
» Replies: 0
» Views: 3
RS485 Modbus SHT30 sensor...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 11:25 PM
» Replies: 3
» Views: 43
KC868-A2v3 FILES
Forum: KC868-A2v3
Last Post: admin
Yesterday, 11:36 AM
» Replies: 1
» Views: 8
KC868-A2v3
Forum: KC868-A2
Last Post: admin
Yesterday, 11:36 AM
» Replies: 1
» Views: 10
KC868-A2v3 PCB layout CAD...
Forum: Schematic & diagram & Dimensions of KinCony PCB layout CAD file
Last Post: admin
Yesterday, 11:35 AM
» Replies: 0
» Views: 8
N30 wire case diagram for...
Forum: N30
Last Post: admin
Yesterday, 01:23 AM
» Replies: 0
» Views: 12
N30 wire case diagram for...
Forum: N30
Last Post: admin
Yesterday, 01:20 AM
» Replies: 0
» Views: 17
Incoming SMS not reported...
Forum: G1
Last Post: JCh
03-30-2026, 02:15 PM
» Replies: 5
» Views: 171
"KCS" v3.24.2 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
03-30-2026, 12:02 AM
» Replies: 2
» Views: 264

  [Arduino source code for KC868-M16]-04 -Read / Write SD card arduino source code
Posted by: admin - 05-04-2023, 06:14 AM - Forum: KC868-M16 / M1 / MB / M30 - No Replies

Code:
#include "FS.h"
#include "SD.h"
#include "SD_MMC.h"
#define BOARD_HAS_1BIT_SDMMC
void WriteFile(fs::FS &fs, const char *path, uint8_t *buf, int len)
{
  //unsigned long start_time = millis();
  Serial.printf("write [%s]...\n", path);

  File file = fs.open(path, FILE_WRITE);
  if (!file) {
    Serial.println("Failed to open file for writing");
    return;
  }
 
  if (!file.write(buf, len)) {
      Serial.println("Write failed");
      return;
    }

  file.flush();
  file.close();

  Serial.printf("Write [%s] Complete", path);
}

void ReadFile(fs::FS &fs, const char *path, uint8_t *buf, int len)
{
  Serial.printf("read [%s]...\n", path);

  File file = fs.open(path);
  if (!file) {
    Serial.println("Failed to open file for reading");
    return;
  }

  if (!file.read(buf, len)) {
      Serial.println("Read failed");
      return;
  }
 
  file.close();

  Serial.printf("Read [%s] Complete: %s", path, buf);
}

void testIO(fs::FS &fs)
{
  char buf[] = "hello world";

  WriteFile(fs, "/test.txt", (uint8_t *)buf, strlen(buf));
  ReadFile(fs, "/test.txt", (uint8_t *)buf, strlen(buf));
}

void setup() {
  pinMode(2,INPUT_PULLUP);
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Please insert SD card");
  delay(1000);
 
  /* SD_MMC 1-bit Mode */
  if (!SD_MMC.begin("/cdcard", true)) {
    Serial.println("Card Mount Failed");
    return;
  }
  testIO(SD_MMC);
  SD_MMC.end(); // cancel SD card mount
}
void loop() {
}
   
after program running, we will find "hello word" have wrote to txt file and saved SD card.
SD card use by "1BIT_SDMMC" work mode.

Print this item

  New house iot project
Posted by: Horlagold - 05-03-2023, 09:19 PM - Forum: DIY Project - Replies (9)

Please help me choose and recommend devices for my home automations

Six water leak sensor
Two Humidity sensor
Two temperature sensor

A device that can control 
three way or four way light switch
One doorbell chime
One energy meter

Print this item

  KC868-M16 16CH CT Clamp Energy Monitor Board Released
Posted by: admin - 05-03-2023, 11:52 AM - Forum: News - No Replies

We have designed KC868-M16 (ESP32 16 Channel CT Clamp Energy Monitor) for home automation DIYer. it can easy integrate to home assistant by ESPHome. the hardware have 16CH CT Clamp sensor INPUT ports + 3CH analog input + Ethernet + WiFi + Bluetooth + DS3231 RTC module + SSD1306 I2C LCD display + SD card.
 
[Image: KC868-M16-1_01.jpg]
[Image: KC868-M16-1_02.jpg]
[Image: KC868-M16-1_03.jpg]
[Image: KC868-M16-1_04.jpg]

Print this item

  KC868-A32 smart control blind motor by home assistant using ESPHome
Posted by: admin - 05-03-2023, 12:36 AM - Forum: Customer project example - No Replies

Print this item

  Kazakhstan agricultural greenhouse automation case by KC868 A8
Posted by: admin - 05-03-2023, 12:36 AM - Forum: Customer project example - No Replies

Print this item

  Maldives case replace H32B with H32B Pro for Tuya and Home Assistant
Posted by: admin - 05-03-2023, 12:35 AM - Forum: Customer project example - Replies (1)

Print this item

  Brazil case for home automation DIY by KC868-A32 Smart Controller
Posted by: admin - 05-03-2023, 12:35 AM - Forum: Customer project example - No Replies

Print this item

  Russia case for smart home voice control by alice speaker
Posted by: admin - 05-03-2023, 12:34 AM - Forum: Customer project example - No Replies

Print this item

  KinCony Controller Setup and Display interfaces case explain from America
Posted by: admin - 05-03-2023, 12:34 AM - Forum: Customer project example - No Replies

Print this item

  Smart Power Distribution Box case from Nepal by KinCony Controller
Posted by: admin - 05-03-2023, 12:33 AM - Forum: Customer project example - No Replies

Print this item