04-14-2023, 03:16 AM
(This post was last modified: 04-14-2023, 03:20 AM by KinCony Support.)
Code:
#include "Arduino.h"
#include "PCF8574.h"
#define SDA 5
#define SCL 4
PCF8574 pcf8574_RE1(0x24,SDA,SCL);//DO
void setup()
{
Serial.begin(115200);
for(int i=0;i<=7;i++)
{
pcf8574_RE1.pinMode(i, OUTPUT);
}
pcf8574_RE1.begin();
for(int i=0;i<=7;i++)
{
pcf8574_RE1.digitalWrite(i, LOW);delay(200);
}
for(int i=0;i<=7;i++)
{
pcf8574_RE1.digitalWrite(i, HIGH);delay(200);
}
}
void loop()
{
/******Output is all off by default, and can be turned
on or off manually when pressed by the keypad**************/
for(int i=0;i<=7;i++)
{
pcf8574_RE1.digitalWrite(i, HIGH);delay(100);
}
}