Code:
#include "Arduino.h"
#include "PCF8575.h"
// Set i2c address
PCF8575 pcf8575_R1(0x24,5,16);
PCF8575 pcf8575_R2(0x25,5,16);
PCF8575 pcf8575_R3(0x21,5,16);
PCF8575 pcf8575_R4(0x22,5,16);
PCF8575 pcf8575_R5(0x26,5,16);
PCF8575 pcf8575_R6(0x27,5,16);
PCF8575 pcf8575_R7(0x20,5,16);
PCF8575 pcf8575_R8(0x23,5,16);
unsigned long timeElapsed;
void setup()
{
Serial.begin(115200);
pcf8575_R1.begin();
pcf8575_R2.begin();
pcf8575_R3.begin();
pcf8575_R4.begin();
pcf8575_R5.begin();
pcf8575_R6.begin();
pcf8575_R7.begin();
pcf8575_R8.begin();
pcf8575_R1.pinMode(P0,OUTPUT);
pcf8575_R1.pinMode(P1,OUTPUT);
pcf8575_R1.pinMode(P2,OUTPUT);
pcf8575_R1.pinMode(P3,OUTPUT);
pcf8575_R1.pinMode(P4,OUTPUT);
pcf8575_R1.pinMode(P5,OUTPUT);
pcf8575_R1.pinMode(P6,OUTPUT);
pcf8575_R1.pinMode(P7,OUTPUT);
pcf8575_R1.pinMode(P8,OUTPUT);
pcf8575_R1.pinMode(P9,OUTPUT);
pcf8575_R1.pinMode(P10,OUTPUT);
pcf8575_R1.pinMode(P11,OUTPUT);
pcf8575_R1.pinMode(P12,OUTPUT);
pcf8575_R1.pinMode(P13,OUTPUT);
pcf8575_R1.pinMode(P14,OUTPUT);
pcf8575_R1.pinMode(P15,OUTPUT);
pcf8575_R2.pinMode(P0,OUTPUT);
pcf8575_R2.pinMode(P1,OUTPUT);
pcf8575_R2.pinMode(P2,OUTPUT);
pcf8575_R2.pinMode(P3,OUTPUT);
pcf8575_R2.pinMode(P4,OUTPUT);
pcf8575_R2.pinMode(P5,OUTPUT);
pcf8575_R2.pinMode(P6,OUTPUT);
pcf8575_R2.pinMode(P7,OUTPUT);
pcf8575_R2.pinMode(P8,OUTPUT);
pcf8575_R2.pinMode(P9,OUTPUT);
pcf8575_R2.pinMode(P10,OUTPUT);
pcf8575_R2.pinMode(P11,OUTPUT);
pcf8575_R2.pinMode(P12,OUTPUT);
pcf8575_R2.pinMode(P13,OUTPUT);
pcf8575_R2.pinMode(P14,OUTPUT);
pcf8575_R2.pinMode(P15,OUTPUT);
pcf8575_R3.pinMode(P0,OUTPUT);
pcf8575_R3.pinMode(P1,OUTPUT);
pcf8575_R3.pinMode(P2,OUTPUT);
pcf8575_R3.pinMode(P3,OUTPUT);
pcf8575_R3.pinMode(P4,OUTPUT);
pcf8575_R3.pinMode(P5,OUTPUT);
pcf8575_R3.pinMode(P6,OUTPUT);
pcf8575_R3.pinMode(P7,OUTPUT);
pcf8575_R3.pinMode(P8,OUTPUT);
pcf8575_R3.pinMode(P9,OUTPUT);
pcf8575_R3.pinMode(P10,OUTPUT);
pcf8575_R3.pinMode(P11,OUTPUT);
pcf8575_R3.pinMode(P12,OUTPUT);
pcf8575_R3.pinMode(P13,OUTPUT);
pcf8575_R3.pinMode(P14,OUTPUT);
pcf8575_R3.pinMode(P15,OUTPUT);
pcf8575_R4.pinMode(P0,OUTPUT);
pcf8575_R4.pinMode(P1,OUTPUT);
pcf8575_R4.pinMode(P2,OUTPUT);
pcf8575_R4.pinMode(P3,OUTPUT);
pcf8575_R4.pinMode(P4,OUTPUT);
pcf8575_R4.pinMode(P5,OUTPUT);
pcf8575_R4.pinMode(P6,OUTPUT);
pcf8575_R4.pinMode(P7,OUTPUT);
pcf8575_R4.pinMode(P8,OUTPUT);
pcf8575_R4.pinMode(P9,OUTPUT);
pcf8575_R4.pinMode(P10,OUTPUT);
pcf8575_R4.pinMode(P11,OUTPUT);
pcf8575_R4.pinMode(P12,OUTPUT);
pcf8575_R4.pinMode(P13,OUTPUT);
pcf8575_R4.pinMode(P14,OUTPUT);
pcf8575_R4.pinMode(P15,OUTPUT);
pcf8575_R5.pinMode(P0,OUTPUT);
pcf8575_R5.pinMode(P1,OUTPUT);
pcf8575_R5.pinMode(P2,OUTPUT);
pcf8575_R5.pinMode(P3,OUTPUT);
pcf8575_R5.pinMode(P4,OUTPUT);
pcf8575_R5.pinMode(P5,OUTPUT);
pcf8575_R5.pinMode(P6,OUTPUT);
pcf8575_R5.pinMode(P7,OUTPUT);
pcf8575_R5.pinMode(P8,OUTPUT);
pcf8575_R5.pinMode(P9,OUTPUT);
pcf8575_R5.pinMode(P10,OUTPUT);
pcf8575_R5.pinMode(P11,OUTPUT);
pcf8575_R5.pinMode(P12,OUTPUT);
pcf8575_R5.pinMode(P13,OUTPUT);
pcf8575_R5.pinMode(P14,OUTPUT);
pcf8575_R5.pinMode(P15,OUTPUT);
pcf8575_R6.pinMode(P0,OUTPUT);
pcf8575_R6.pinMode(P1,OUTPUT);
pcf8575_R6.pinMode(P2,OUTPUT);
pcf8575_R6.pinMode(P3,OUTPUT);
pcf8575_R6.pinMode(P4,OUTPUT);
pcf8575_R6.pinMode(P5,OUTPUT);
pcf8575_R6.pinMode(P6,OUTPUT);
pcf8575_R6.pinMode(P7,OUTPUT);
pcf8575_R6.pinMode(P8,OUTPUT);
pcf8575_R6.pinMode(P9,OUTPUT);
pcf8575_R6.pinMode(P10,OUTPUT);
pcf8575_R6.pinMode(P11,OUTPUT);
pcf8575_R6.pinMode(P12,OUTPUT);
pcf8575_R6.pinMode(P13,OUTPUT);
pcf8575_R6.pinMode(P14,OUTPUT);
pcf8575_R6.pinMode(P15,OUTPUT);
pcf8575_R7.pinMode(P0,OUTPUT);
pcf8575_R7.pinMode(P1,OUTPUT);
pcf8575_R7.pinMode(P2,OUTPUT);
pcf8575_R7.pinMode(P3,OUTPUT);
pcf8575_R7.pinMode(P4,OUTPUT);
pcf8575_R7.pinMode(P5,OUTPUT);
pcf8575_R7.pinMode(P6,OUTPUT);
pcf8575_R7.pinMode(P7,OUTPUT);
pcf8575_R7.pinMode(P8,OUTPUT);
pcf8575_R7.pinMode(P9,OUTPUT);
pcf8575_R7.pinMode(P10,OUTPUT);
pcf8575_R7.pinMode(P11,OUTPUT);
pcf8575_R7.pinMode(P12,OUTPUT);
pcf8575_R7.pinMode(P13,OUTPUT);
pcf8575_R7.pinMode(P14,OUTPUT);
pcf8575_R7.pinMode(P15,OUTPUT);
pcf8575_R8.pinMode(P0,OUTPUT);
pcf8575_R8.pinMode(P1,OUTPUT);
pcf8575_R8.pinMode(P2,OUTPUT);
pcf8575_R8.pinMode(P3,OUTPUT);
pcf8575_R8.pinMode(P4,OUTPUT);
pcf8575_R8.pinMode(P5,OUTPUT);
pcf8575_R8.pinMode(P6,OUTPUT);
pcf8575_R8.pinMode(P7,OUTPUT);
pcf8575_R8.pinMode(P8,OUTPUT);
pcf8575_R8.pinMode(P9,OUTPUT);
pcf8575_R8.pinMode(P10,OUTPUT);
pcf8575_R8.pinMode(P11,OUTPUT);
pcf8575_R8.pinMode(P12,OUTPUT);
pcf8575_R8.pinMode(P13,OUTPUT);
pcf8575_R8.pinMode(P14,OUTPUT);
pcf8575_R8.pinMode(P15,OUTPUT);
}
void loop()
{
//R1 LOW----------------------
pcf8575_R1.digitalWrite(P0,LOW);
delay(50);
pcf8575_R1.digitalWrite(P1,LOW);
delay(50);
pcf8575_R1.digitalWrite(P2,LOW);
delay(50);
pcf8575_R1.digitalWrite(P3,LOW);
delay(50);
pcf8575_R1.digitalWrite(P4,LOW);
delay(50);
pcf8575_R1.digitalWrite(P5,LOW);
delay(50);
pcf8575_R1.digitalWrite(P6,LOW);
delay(50);
pcf8575_R1.digitalWrite(P7,LOW);
delay(50);
pcf8575_R1.digitalWrite(P8,LOW);
delay(50);
pcf8575_R1.digitalWrite(P9,LOW);
delay(50);
pcf8575_R1.digitalWrite(P10,LOW);
delay(50);
pcf8575_R1.digitalWrite(P11,LOW);
delay(50);
pcf8575_R1.digitalWrite(P12,LOW);
delay(50);
pcf8575_R1.digitalWrite(P13,LOW);
delay(50);
pcf8575_R1.digitalWrite(P14,LOW);
delay(50);
pcf8575_R1.digitalWrite(P15,LOW);
delay(50);
//R2 LOW------------------------
pcf8575_R2.digitalWrite(P0,LOW);
delay(50);
pcf8575_R2.digitalWrite(P1,LOW);
delay(50);
pcf8575_R2.digitalWrite(P2,LOW);
delay(50);
pcf8575_R2.digitalWrite(P3,LOW);
delay(50);
pcf8575_R2.digitalWrite(P4,LOW);
delay(50);
pcf8575_R2.digitalWrite(P5,LOW);
delay(50);
pcf8575_R2.digitalWrite(P6,LOW);
delay(50);
pcf8575_R2.digitalWrite(P7,LOW);
delay(50);
pcf8575_R2.digitalWrite(P8,LOW);
delay(50);
pcf8575_R2.digitalWrite(P9,LOW);
delay(50);
pcf8575_R2.digitalWrite(P10,LOW);
delay(50);
pcf8575_R2.digitalWrite(P11,LOW);
delay(50);
pcf8575_R2.digitalWrite(P12,LOW);
delay(50);
pcf8575_R2.digitalWrite(P13,LOW);
delay(50);
pcf8575_R2.digitalWrite(P14,LOW);
delay(50);
pcf8575_R2.digitalWrite(P15,LOW);
delay(50);
//R3 LOW------------------------
pcf8575_R3.digitalWrite(P0,LOW);
delay(50);
pcf8575_R3.digitalWrite(P1,LOW);
delay(50);
pcf8575_R3.digitalWrite(P2,LOW);
delay(50);
pcf8575_R3.digitalWrite(P3,LOW);
delay(50);
pcf8575_R3.digitalWrite(P4,LOW);
delay(50);
pcf8575_R3.digitalWrite(P5,LOW);
delay(50);
pcf8575_R3.digitalWrite(P6,LOW);
delay(50);
pcf8575_R3.digitalWrite(P7,LOW);
delay(50);
pcf8575_R3.digitalWrite(P8,LOW);
delay(50);
pcf8575_R3.digitalWrite(P9,LOW);
delay(50);
pcf8575_R3.digitalWrite(P10,LOW);
delay(50);
pcf8575_R3.digitalWrite(P11,LOW);
delay(50);
pcf8575_R3.digitalWrite(P12,LOW);
delay(50);
pcf8575_R3.digitalWrite(P13,LOW);
delay(50);
pcf8575_R3.digitalWrite(P14,LOW);
delay(50);
pcf8575_R3.digitalWrite(P15,LOW);
delay(50);
//R4 LOW------------------------
pcf8575_R4.digitalWrite(P0,LOW);
delay(50);
pcf8575_R4.digitalWrite(P1,LOW);
delay(50);
pcf8575_R4.digitalWrite(P2,LOW);
delay(50);
pcf8575_R4.digitalWrite(P3,LOW);
delay(50);
pcf8575_R4.digitalWrite(P4,LOW);
delay(50);
pcf8575_R4.digitalWrite(P5,LOW);
delay(50);
pcf8575_R4.digitalWrite(P6,LOW);
delay(50);
pcf8575_R4.digitalWrite(P7,LOW);
delay(50);
pcf8575_R4.digitalWrite(P8,LOW);
delay(50);
pcf8575_R4.digitalWrite(P9,LOW);
delay(50);
pcf8575_R4.digitalWrite(P10,LOW);
delay(50);
pcf8575_R4.digitalWrite(P11,LOW);
delay(50);
pcf8575_R4.digitalWrite(P12,LOW);
delay(50);
pcf8575_R4.digitalWrite(P13,LOW);
delay(50);
pcf8575_R4.digitalWrite(P14,LOW);
delay(50);
pcf8575_R4.digitalWrite(P15,LOW);
delay(50);
//R5 LOW----------------------
pcf8575_R5.digitalWrite(P0,LOW);
delay(50);
pcf8575_R5.digitalWrite(P1,LOW);
delay(50);
pcf8575_R5.digitalWrite(P2,LOW);
delay(50);
pcf8575_R5.digitalWrite(P3,LOW);
delay(50);
pcf8575_R5.digitalWrite(P4,LOW);
delay(50);
pcf8575_R5.digitalWrite(P5,LOW);
delay(50);
pcf8575_R5.digitalWrite(P6,LOW);
delay(50);
pcf8575_R5.digitalWrite(P7,LOW);
delay(50);
pcf8575_R5.digitalWrite(P8,LOW);
delay(50);
pcf8575_R5.digitalWrite(P9,LOW);
delay(50);
pcf8575_R5.digitalWrite(P10,LOW);
delay(50);
pcf8575_R5.digitalWrite(P11,LOW);
delay(50);
pcf8575_R5.digitalWrite(P12,LOW);
delay(50);
pcf8575_R5.digitalWrite(P13,LOW);
delay(50);
pcf8575_R5.digitalWrite(P14,LOW);
delay(50);
pcf8575_R5.digitalWrite(P15,LOW);
delay(50);
//R6 LOW------------------------
pcf8575_R6.digitalWrite(P0,LOW);
delay(50);
pcf8575_R6.digitalWrite(P1,LOW);
delay(50);
pcf8575_R6.digitalWrite(P2,LOW);
delay(50);
pcf8575_R6.digitalWrite(P3,LOW);
delay(50);
pcf8575_R6.digitalWrite(P4,LOW);
delay(50);
pcf8575_R6.digitalWrite(P5,LOW);
delay(50);
pcf8575_R6.digitalWrite(P6,LOW);
delay(50);
pcf8575_R6.digitalWrite(P7,LOW);
delay(50);
pcf8575_R6.digitalWrite(P8,LOW);
delay(50);
pcf8575_R6.digitalWrite(P9,LOW);
delay(50);
pcf8575_R6.digitalWrite(P10,LOW);
delay(50);
pcf8575_R6.digitalWrite(P11,LOW);
delay(50);
pcf8575_R6.digitalWrite(P12,LOW);
delay(50);
pcf8575_R6.digitalWrite(P13,LOW);
delay(50);
pcf8575_R6.digitalWrite(P14,LOW);
delay(50);
pcf8575_R6.digitalWrite(P15,LOW);
delay(50);
//R7 LOW------------------------
pcf8575_R7.digitalWrite(P0,LOW);
delay(50);
pcf8575_R7.digitalWrite(P1,LOW);
delay(50);
pcf8575_R7.digitalWrite(P2,LOW);
delay(50);
pcf8575_R7.digitalWrite(P3,LOW);
delay(50);
pcf8575_R7.digitalWrite(P4,LOW);
delay(50);
pcf8575_R7.digitalWrite(P5,LOW);
delay(50);
pcf8575_R7.digitalWrite(P6,LOW);
delay(50);
pcf8575_R7.digitalWrite(P7,LOW);
delay(50);
pcf8575_R7.digitalWrite(P8,LOW);
delay(50);
pcf8575_R7.digitalWrite(P9,LOW);
delay(50);
pcf8575_R7.digitalWrite(P10,LOW);
delay(50);
pcf8575_R7.digitalWrite(P11,LOW);
delay(50);
pcf8575_R7.digitalWrite(P12,LOW);
delay(50);
pcf8575_R7.digitalWrite(P13,LOW);
delay(50);
pcf8575_R7.digitalWrite(P14,LOW);
delay(50);
pcf8575_R7.digitalWrite(P15,LOW);
delay(50);
//R8 LOW------------------------
pcf8575_R8.digitalWrite(P0,LOW);
delay(50);
pcf8575_R8.digitalWrite(P1,LOW);
delay(50);
pcf8575_R8.digitalWrite(P2,LOW);
delay(50);
pcf8575_R8.digitalWrite(P3,LOW);
delay(50);
pcf8575_R8.digitalWrite(P4,LOW);
delay(50);
pcf8575_R8.digitalWrite(P5,LOW);
delay(50);
pcf8575_R8.digitalWrite(P6,LOW);
delay(50);
pcf8575_R8.digitalWrite(P7,LOW);
delay(50);
pcf8575_R8.digitalWrite(P8,LOW);
delay(50);
pcf8575_R8.digitalWrite(P9,LOW);
delay(50);
pcf8575_R8.digitalWrite(P10,LOW);
delay(50);
pcf8575_R8.digitalWrite(P11,LOW);
delay(50);
pcf8575_R8.digitalWrite(P12,LOW);
delay(50);
pcf8575_R8.digitalWrite(P13,LOW);
delay(50);
pcf8575_R8.digitalWrite(P14,LOW);
delay(50);
pcf8575_R8.digitalWrite(P15,LOW);
delay(50);
//R1 HIGH-----------------------
pcf8575_R1.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R1.digitalWrite(P15,HIGH);
delay(50);
//R3 HIGH------------------------
pcf8575_R2.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R2.digitalWrite(P15,HIGH);
delay(50);
//R3 HIGH-----------------------
pcf8575_R3.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R3.digitalWrite(P15,HIGH);
delay(50);
//R4 HIGH------------------------
pcf8575_R4.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R4.digitalWrite(P15,HIGH);
delay(100);
//R5 HIGH-----------------------
pcf8575_R5.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R5.digitalWrite(P15,HIGH);
delay(50);
//R6 HIGH------------------------
pcf8575_R6.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R6.digitalWrite(P15,HIGH);
delay(50);
//R7 HIGH-----------------------
pcf8575_R7.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R7.digitalWrite(P15,HIGH);
delay(50);
//R8 HIGH------------------------
pcf8575_R8.digitalWrite(P0,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P1,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P2,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P3,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P4,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P5,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P6,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P7,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P8,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P9,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P10,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P11,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P12,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P13,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P14,HIGH);
delay(50);
pcf8575_R8.digitalWrite(P15,HIGH);
delay(100);
}