#include <PCA9534.h>
/* Example usage for PCA9534 library by Abdulrahman Saleh Khamis. */
int nRSTGP = 0; // nRSTGP connected to GPIO-0 as output
int ENMOTOR = 1; // ENMOTOR connected to GPIO-1 as output
int MDRIVE1 = 2; // MDRIVE1 connected to GPIO-2 as output
int MDRIVE2 = 3; // MDRIVE2 connected to GPIO-3 as output
int EP4 = 4 ; // EP4 LED connected to GPIO-4 as output
int EP5 = 5; // EP5 LED connected to GPIO-5 as ou
int ENPRESURE = 6; // ENPRESURE connected to GPIO-6 as output
int ENULTRA = 7; // ENULTRA connected to GPIO-7 as output
PCA9534 gpio;
// Helps ensure the application loop is not interrupted by the system
// background processing and network management.
SYSTEM_THREAD(ENABLED);
void setup() {
gpio.begin();
gpio.pinMode(nRSTGP, OUTPUT);
gpio.pinMode(ENMOTOR, OUTPUT);
gpio.pinMode(MDRIVE1, OUTPUT);
gpio.pinMode(MDRIVE2, OUTPUT);
gpio.pinMode(EP4, OUTPUT);
gpio.pinMode(EP5, OUTPUT);
gpio.pinMode(ENPRESURE, OUTPUT);
gpio.pinMode(ENULTRA, OUTPUT);
pinMode(D2, OUTPUT);
}
void loop() {
// gpio.digitalWrite(EP4, HIGH); // LED On
// gpio.digitalWrite(EP4, HIGH); // LED Off
Wire.beginTransmission(0x20);
Wire.write(0x01);
Wire.write(0xff);
Wire.endTransmission();
digitalWrite(D2, HIGH);
delay(100);
// gpio.digitalWrite(EP5, LOW); // LED On
// gpio.digitalWrite(EP5, LOW); // LED Off
Wire.beginTransmission(0x20);
Wire.write(0x01);
Wire.write(0x00);
Wire.endTransmission();
digitalWrite(D2, LOW);
delay(100);
}
on the scope there is a missing third byte, writing 0x00 or 0xff is not present in the bit stream
this is a show stopper