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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,262
» Latest member: globalgadgets
» Forum threads: 3,613
» Forum posts: 18,632

Full Statistics

Online Users
There are currently 4 online users.
» 0 Member(s) | 1 Guest(s)
bot

Latest Threads
Some bugs in Home Assista...
Forum: N60
Last Post: VeikkoPeikko
1 hour ago
» Replies: 2
» Views: 33
MODBUS TCP ETHERNET - SLA...
Forum: KC868-A16
Last Post: admin
8 hours ago
» Replies: 5
» Views: 967
KC868 server16 and GSM mo...
Forum: KinCony AS
Last Post: admin
8 hours ago
» Replies: 12
» Views: 1,677
IFTTT T64M
Forum: "KCS" v3 firmware
Last Post: admin
8 hours ago
» Replies: 3
» Views: 30
easy way to export/import...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
8 hours ago
» Replies: 5
» Views: 5,505
KC868-E16T added Tuya mod...
Forum: KC868-E16T
Last Post: admin
12-14-2025, 11:27 PM
» Replies: 6
» Views: 630
how to integrate KC868-A8...
Forum: KC868-A8
Last Post: admin
12-14-2025, 11:25 PM
» Replies: 46
» Views: 7,111
KC868-A2 SIM7600 with Tuy...
Forum: KC868-A2
Last Post: admin
12-13-2025, 11:29 PM
» Replies: 32
» Views: 3,241
RF doesnt show up?
Forum: KC868-A16v3
Last Post: Borg357
12-13-2025, 09:16 PM
» Replies: 2
» Views: 27
KC868-A16 rs485
Forum: KC868-A16
Last Post: admin
12-13-2025, 02:21 PM
» Replies: 7
» Views: 96

Heart [Arduino IDE demo source code for KC868-A6]--#09-RS485_code
Posted by: KinCony Support - 04-25-2022, 08:55 AM - Forum: KC868-A6 - Replies (15)

[Arduino IDE demo source code for KC868-A6]--#09-RS485_code

Code:
void setup(){

  Serial2.begin(9600);
}

void loop() {
Serial2.println("KinCony");

}

.zip   9.RS485.zip (Size: 469.3 KB / Downloads: 974)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#08-PCF8574-relay code
Posted by: KinCony Support - 04-25-2022, 08:55 AM - Forum: KC868-A6 - Replies (4)

[Arduino IDE demo source code for KC868-A6]--#08-PCF8574-DO_code

Code:
/*
Blink led on PIN0
by Mischianti Renzo <http://www.mischianti.org>

https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*/

#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address
PCF8574 pcf8574(0x24,4,15);

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

    // Set pinMode to OUTPUT
    pcf8574.pinMode(P0, OUTPUT);
  pcf8574.pinMode(P1, OUTPUT);
  pcf8574.pinMode(P2, OUTPUT);
  pcf8574.pinMode(P3, OUTPUT);
  pcf8574.pinMode(P4, OUTPUT);
  pcf8574.pinMode(P5, OUTPUT);


  pcf8574.digitalWrite(P0, HIGH);
  pcf8574.digitalWrite(P1, HIGH);
  pcf8574.digitalWrite(P2, HIGH);
  pcf8574.digitalWrite(P3, HIGH);
  pcf8574.digitalWrite(P4, HIGH);
  pcf8574.digitalWrite(P5, HIGH);

    Serial.print("Init pcf8574...");
    if (pcf8574.begin()){
        Serial.println("OK");
    }else{
        Serial.println("KO");
    }
}

void loop()
{
    delay(300);
    pcf8574.digitalWrite(P0, LOW);
  delay(300);
  pcf8574.digitalWrite(P1, LOW);
  delay(300);
  pcf8574.digitalWrite(P2, LOW);
  delay(300);
  pcf8574.digitalWrite(P3, LOW);
  delay(300);
  pcf8574.digitalWrite(P4, LOW);
  delay(300);
  pcf8574.digitalWrite(P5, LOW);
  delay(300);
}

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#07-PCF8574-Digital input code
Posted by: KinCony Support - 04-25-2022, 08:54 AM - Forum: KC868-A6 - Replies (8)

[Arduino IDE demo source code for KC868-A6]--#07-PCF8574-DI_code

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

// Set i2c address
PCF8574 pcf8574(0x22,4,15);
unsigned long timeElapsed;
void setup()
{
Serial.begin(115200);
delay(1000);

pcf8574.pinMode(P0, INPUT);
pcf8574.pinMode(P1, INPUT);
pcf8574.pinMode(P2, INPUT);
pcf8574.pinMode(P3, INPUT);
pcf8574.pinMode(P4, INPUT);
pcf8574.pinMode(P5, INPUT);
pcf8574.pinMode(P6, INPUT);
pcf8574.pinMode(P7, INPUT);

    Serial.print("Init pcf8574...");
    if (pcf8574.begin()){
        Serial.println("OK");
    }else{
        Serial.println("KO");
    }
}

void loop()
{
uint8_t val1 = pcf8574.digitalRead(P0);
uint8_t val2 = pcf8574.digitalRead(P1);
uint8_t val3 = pcf8574.digitalRead(P2);
uint8_t val4 = pcf8574.digitalRead(P3);
uint8_t val5 = pcf8574.digitalRead(P4);
uint8_t val6 = pcf8574.digitalRead(P5);
uint8_t val7 = pcf8574.digitalRead(P6);
uint8_t val8 = pcf8574.digitalRead(P7);
if (val1==LOW) Serial.println("KEY1 PRESSED");
if (val2==LOW) Serial.println("KEY2 PRESSED");
if (val3==LOW) Serial.println("KEY3 PRESSED");
if (val4==LOW) Serial.println("KEY4 PRESSED");
if (val5==LOW) Serial.println("KEY5 PRESSED");
if (val6==LOW) Serial.println("KEY6 PRESSED");
if (val7==LOW) Serial.println("KEY7 PRESSED");
if (val8==LOW) Serial.println("KEY8 PRESSED");
    delay(300);
}

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#06-OLED_SSD1306_code
Posted by: KinCony Support - 04-25-2022, 08:53 AM - Forum: KC868-A6 - Replies (10)

[Arduino IDE demo source code for KC868-A6]--#06-OLED_SSD1306_code

Code:
/*OLED SSD1306 Code for KC868-A6*/

#include <U8g2lib.h>
#include <Wire.h>

U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  15, 4, U8X8_PIN_NONE);//SCL IO15  SDA  IO4

void page1() {
  u8g2.setFont(u8g2_font_timR18_tf);// Font 18
  u8g2.setFontPosTop();
  u8g2.setCursor(5,0);
  u8g2.print("KINCONY");
  u8g2.setFont(u8g2_font_timR12_tf);//Font 12
  u8g2.setCursor(0,40);
  u8g2.print("www.kincony.com");
}
void setup(){
  u8g2.setI2CAddress(0x3C*2);
  u8g2.begin();
  u8g2.enableUTF8Print();
}
void loop(){
  u8g2.firstPage();
  do
  {
    page1();
  }while(u8g2.nextPage());

}
   
.zip   6.OLED-1306.zip (Size: 810 bytes / Downloads: 855)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#05-Ds1307_code
Posted by: KinCony Support - 04-25-2022, 08:51 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#05-Ds1307_code

Code:
/*KC868-A6 DS1307 CODE*/
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include "RTClib.h"

RTC_DS1307 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

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

#ifndef ESP8266
  while (!Serial); // wait for serial port to connect. Needed for native USB
#endif

  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    Serial.flush();
    while (1) delay(10);
  }

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running, let's set the time!");
    // When time needs to be set on a new device, or after a power loss, the
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }

  // When time needs to be re-set on a previously configured device, the
  // following line sets the RTC to the date & time this sketch was compiled
  // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  // This line sets the RTC with an explicit date & time, for example to set
  // January 21, 2014 at 3am you would call:
  // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}

void loop () {
    DateTime now = rtc.now();

    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();

    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");

    // calculate a date which is 7 days, 12 hours, 30 minutes, and 6 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));

    Serial.print(" now + 7d + 12h + 30m + 6s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();

    Serial.println();
    delay(3000);
}

.zip   5.ds1307.zip (Size: 111.96 KB / Downloads: 771)
.txt   KC868-A6_pin_define.txt (Size: 421 bytes / Downloads: 856)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#04-Ds18b20_code
Posted by: KinCony Support - 04-25-2022, 08:49 AM - Forum: KC868-A6 - Replies (4)

[Arduino IDE demo source code for KC868-A6]--#04-Ds18b20_code

Code:
/*KC868-A6 DS18B20 CODE*/
#include <DS18B20.h>
DS18B20 ds1(32);  //channel-1-DS18b20
DS18B20 ds2(33);  //channel-2-DS18b20

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

void loop()
{
  Serial.print("Temperature1:");
  Serial.print(ds1.getTempC());
  Serial.print(" C /");
  delay(500);
  Serial.print("Temperature2:");
  Serial.print(ds2.getTempC());
  Serial.print(" C /\n");
  delay(500); 
}

.zip   4.ds18b20.zip (Size: 674 bytes / Downloads: 722)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#03-DAC_code
Posted by: KinCony Support - 04-25-2022, 08:48 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#03-DAC_code

Code:
/*KC868-A6 DAC CODE*/
#define DAC1 26
#define DAC2 25

void setup() {
 
}

void loop() {
  int Value = 127; //255= 10V
 
  dacWrite(DAC1, 127);
  delay(500);
  dacWrite(DAC2, 255);
  delay(500);
}


.zip   3.DAC.zip (Size: 573 bytes / Downloads: 658)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#02-ADC_code
Posted by: KinCony Support - 04-25-2022, 08:46 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#02-ADC_code

Code:
/*KC868-A6 ADC code*/
#include "Arduino.h"
#include "PCF8574.h"

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

void setup()
{
    Serial.begin(115200);
  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  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));
  delay(500);
}

.zip   ADC.zip (Size: 547 bytes / Downloads: 675)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#01-nRF24L01_code
Posted by: KinCony Support - 04-25-2022, 08:43 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#01-nRF24L01_code
Receive code

Code:
/*Receive code*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 22
#define CSN_PIN 5

const uint64_t id = 0xE8E8F0F0E1LL;

RF24 radio(CE_PIN, CSN_PIN);

#define SIZE 32            // this is the maximum for this example. (minimum is 1)
char buffer[SIZE + 1];     // for the RX node
uint8_t counter = 0;       // for counting the number of received payloads

void setup()
{
   Serial.begin(9600);
   delay(1000);
   Serial.println("Nrf24L01 Receiver Starting");
   radio.begin();
   radio.openReadingPipe(1,id);
   radio.startListening();;
}

void loop()
{
    if (radio.available()) {         // is there a payload?
      radio.read(&buffer, SIZE);     // fetch payload from FIFO
      Serial.print("Received:");
      Serial.print(buffer);          // print the payload's value
      Serial.print(" - ");
      Serial.println(counter++);     // print the received counter
    }
}


Transmitter code

Code:
/*Transmitter code*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 22
#define CSN_PIN 5

const uint64_t abc = 0xE8E8F0F0E1LL;

RF24 radio(CE_PIN, CSN_PIN);
char data[] = "Hello World, KinCony";

void setup()
{
   Serial.begin(9600);
   radio.begin();
   radio.openWritingPipe(abc);
}

void loop()
{
   radio.write( data, sizeof(data) );
}
   

.zip   1.nRF24L01.zip (Size: 1.5 KB / Downloads: 667)


.txt   KC868-A6_pin_define.txt (Size: 421 bytes / Downloads: 543)

Print this item

  KC868-A6 ESP32 home automation relay module released!
Posted by: admin - 04-25-2022, 07:10 AM - Forum: News - Replies (6)

We have designed KC868-A6 smart controller , many hardware resource for you to use, added LoRa and nRF24L01 wireless module interface and SSD1306 OLED and RS485 and RTC clock chip DS1307.
 
[Image: KC868-A6-1_01.jpg]
[Image: KC868-A6-1_02.jpg]
[Image: KC868-A6-1_03.jpg]
[Image: KC868-A6-1_04.jpg]
[Image: KC868-A6-1_05.jpg]

Print this item