[Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI - 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: [Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI (/showthread.php?tid=1619) |
[Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI - KinCony Support - 01-05-2022 Code 6: //The demo code is PCF8574-DI You can copy the code to your Arduino IDE Code: #include "Arduino.h" RE: [Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI - -Teme- - 01-05-2022 Based of your schema, i2c address are another way around than in config above - which one is correct? from schema; PCF8574 (0x22) ports IN D1...8 and (0x21) ports IN D9...16 https://www.kincony.com/download/KC868-A16-schematic.pdf RE: [Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI - admin - 01-05-2022 You are right. For KC868-A16 // Set i2c address for output PCF8574 pcf8574_1(0x24); // channel 1-8 adress:100100 PCF8574 pcf8574_2(0x25); //channel 9-16 adress:100101 // Set i2c address for input PCF8574 pcf8574_1(0x22); // channel 1-8 adress: 100010 PCF8574 pcf8574_2(0x21); //channel 9-16 adress: 100001 RE: [Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI - schel4ok - 02-07-2022 What is the reason to restrict 16 pins only for input and another 16pins only for output? What happens if I configure certain output pin as input? In my project I need more inputs and in Arduino boards pins can be configured without any limits. RE: [Arduino IDE demo source code for KC868-A16]--#07-PCF8574-DI - admin - 02-11-2022 because input pins have optocoupler isolator. output pins connect with MOSFET. how many input and output ports you will use? |