DS1307 RTC - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-A16 (https://www.kincony.com/forum/forumdisplay.php?fid=25) +--- Thread: DS1307 RTC (/showthread.php?tid=2675) Pages:
1
2
|
DS1307 RTC - Olsen@HuaHin - 03-13-2023 Hello everybody! I am looking at adding a DS1307 RTC connected via I2C, anyone you can recommended that has been testet and easy to connect? Presume source code are the same as for the KC868-A6. RE: DS1307 RTC - admin - 03-13-2023 here is DS1307 RTC arduino demo code for KC868-A6: https://www.kincony.com/forum/showthread.php?tid=1863 if you want to use DS1307 connect to IIC bus extender , also can use A6's code, just define the GPIOs for SDA and SCL pin. RE: DS1307 RTC - Olsen@HuaHin - 03-13-2023 (03-13-2023, 11:05 AM)admin Wrote: here is DS1307 RTC arduino demo code for KC868-A6: Thanks Any DS1307 RTC you can recommend to use that will work on the KC868-A16 and are easy to connect RE: DS1307 RTC - admin - 03-13-2023 any DS1307 chip can use, just define correct I2C bus pins is ok. RE: DS1307 RTC - Olsen@HuaHin - 03-27-2023 I have finally received my KC868-A16 board and found that the I1C uses special plug What type of plug is this as I need to connect RTC module see attached pictures. RE: DS1307 RTC - admin - 03-27-2023 you can use "DuPont Line" connect with each pins. RE: DS1307 RTC - Olsen@HuaHin - 04-08-2023 I have now got my DS1307 connected and RTClib.h including Adafruit BusIO (i2c) in my sketch I have not been able to find in any demo code in the forum how to define SDA & SCL (4, 5 for the KC868-A16 board) in Arduino IDE Tried the example from KC868-A6 -- #05-DS1307 demo If I try IIC SDA:4 & IIC SCL:5 as in I-O pin define (KC868-A16 I-O pin define) it comes up with an error. RE: DS1307 RTC - Olsen@HuaHin - 04-08-2023 I think I found the solution, se below. // Set i2c for RTC DS1307 #define SDA:4 #define SCL:5 or // Set i2c for RTC DS1307 #define IIC SDA:4 #define IIC SCL:5 or // Set i2c for RTC DS1307 #define i2c SDA:4 #define i2c SCL:5 Which one is the correct one??? RE: DS1307 RTC - admin - 04-08-2023 IIC SDA:4 IIC SCL:5 you should set it in your arduino "pins_arduino.h" file set SDA and SCL pins. RE: DS1307 RTC - Olsen@HuaHin - 04-08-2023 (04-08-2023, 11:37 AM)admin Wrote: IIC SDA:4 All good, but I don't see the use of a library "pins_arduino.h" in any of your source code examples. Is there not a source code for KC868-A16 showing the complete pin-define for the board as that would be the first step to do when starting a sketch regardless of what you want to code so that all pins are available now and later on in a project. Does anybody have an example including the complete pin-define for the KCS868-A16????? |