04-12-2024, 06:32 AM
Code:
#include <PCA95x5.h>
PCA9555 ioex;
void setup() {
Serial.begin(115200);
delay(2000);
Wire.begin(11,10,40000);
ioex.attach(Wire,0x24);
ioex.polarity(PCA95x5::Polarity::ORIGINAL_ALL);
ioex.direction(PCA95x5::Direction::IN_ALL);
}
void loop() {
Serial.println(ioex.read(), BIN);
delay(1000);
}
source code download:
XL9535_input.zip (Size: 372 bytes / Downloads: 64)
before use XL9535 chip, you need to install PCA95x5 arduino library: