Smart Home Automation Forum
[Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_co - 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-A8S (https://www.kincony.com/forum/forumdisplay.php?fid=24)
+--- Thread: [Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_co (/showthread.php?tid=1956)



[Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_co - KinCony Support - 06-01-2022

[Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_code

Code:
/*KC868-A8S  PCF8574 Digital output code*/

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

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

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.pinMode(P6, OUTPUT);
  pcf8574.pinMode(P7, OUTPUT);
   pcf8574.begin();
   
}

void loop()
{
   pcf8574.digitalWrite(P0, HIGH);  delay(300); 
   pcf8574.digitalWrite(P1, HIGH);  delay(300); 
   pcf8574.digitalWrite(P2, HIGH);  delay(300); 
   pcf8574.digitalWrite(P3, HIGH);  delay(300);
   pcf8574.digitalWrite(P4, HIGH);  delay(300); 
   pcf8574.digitalWrite(P5, HIGH);  delay(300);
   pcf8574.digitalWrite(P6, HIGH);  delay(300); 
   pcf8574.digitalWrite(P7, HIGH);  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);
   pcf8574.digitalWrite(P6, LOW);   delay(300);
   pcf8574.digitalWrite(P7, LOW);   delay(300);

}



RE: [Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_co - katheesh - 08-03-2023

(06-01-2022, 01:20 AM)KinCony Support Wrote: [Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_code

Code:
/*KC868-A8S  PCF8574 Digital output code*/

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

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

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.pinMode(P6, OUTPUT);
  pcf8574.pinMode(P7, OUTPUT);
   pcf8574.begin();
  
}

void loop()
{
   pcf8574.digitalWrite(P0, HIGH);  delay(300); 
   pcf8574.digitalWrite(P1, HIGH);  delay(300); 
   pcf8574.digitalWrite(P2, HIGH);  delay(300); 
   pcf8574.digitalWrite(P3, HIGH);  delay(300);
   pcf8574.digitalWrite(P4, HIGH);  delay(300); 
   pcf8574.digitalWrite(P5, HIGH);  delay(300);
   pcf8574.digitalWrite(P6, HIGH);  delay(300); 
   pcf8574.digitalWrite(P7, HIGH);  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);
   pcf8574.digitalWrite(P6, LOW);   delay(300);
   pcf8574.digitalWrite(P7, LOW);   delay(300);

}

How to solve this issue? your example code is not compiled by my Arduino IDE. help me to solve this issue!


RE: [Arduino IDE demo source code for KC868-A8S]--#07-KC868-A8S_PCF8574-Digital output_co - admin - 08-03-2023

here is PCF8574 arduino library we have used.

.zip   PCF8574_library.zip (Size: 23.8 MB / Downloads: 175)