You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first I had errors with the I²C communication. I find that with ESP32 we must use pins 21 and 22 for SDA and SCL.
So the I²C communication works now.
But I can't read input of buttons added on the SX1509 board, or turn on a LED.
Remark : I tested the SX1509 on an Arduino UNO and it works.
This is my code (I use Arduino IDE) :
#define I2C_SDA 21
#define I2C_SCL 22
const byte SX1509_ADDRESS = 0x3E;
SX1509 sx1509io;
in setup() :
Wire.begin(I2C_SDA, I2C_SCL);
if (sx1509io.begin(SX1509_ADDRESS) == false) {
Serial.println("Failed to communicate. Check wiring and address of SX1509.");
}
//LED on pin 15
sx1509io.pinMode(15, OUTPUT);
// Blink the LED a few times before we start:
for (int i = 0; i < 5; i++) {
sx1509io.digitalWrite(15, HIGH);
delay(100);
sx1509io.digitalWrite(15, LOW);
delay(100);
}
//Button on pin 0
sx1509io.pinMode(0, INPUT_PULLUP);
in loop() :
if (sx1509io.digitalRead(0) == LOW) {
Serial.println("button1 pushed !!!");
}
The text was updated successfully, but these errors were encountered:
7heS4ge
changed the title
I can't get it to work the SX1509 board with a ESP32-DevKitC V4 (WROOM 32U)
I can't get the SX1509 board to work with a ESP32-DevKitC V4 (WROOM 32U)
Apr 10, 2025
At first I had errors with the I²C communication. I find that with ESP32 we must use pins 21 and 22 for SDA and SCL.
So the I²C communication works now.
But I can't read input of buttons added on the SX1509 board, or turn on a LED.
Remark : I tested the SX1509 on an Arduino UNO and it works.
This is my code (I use Arduino IDE) :
#define I2C_SDA 21
#define I2C_SCL 22
const byte SX1509_ADDRESS = 0x3E;
SX1509 sx1509io;
in setup() :
Wire.begin(I2C_SDA, I2C_SCL);
if (sx1509io.begin(SX1509_ADDRESS) == false) {
Serial.println("Failed to communicate. Check wiring and address of SX1509.");
}
//LED on pin 15
sx1509io.pinMode(15, OUTPUT);
// Blink the LED a few times before we start:
for (int i = 0; i < 5; i++) {
sx1509io.digitalWrite(15, HIGH);
delay(100);
sx1509io.digitalWrite(15, LOW);
delay(100);
}
//Button on pin 0
sx1509io.pinMode(0, INPUT_PULLUP);
in loop() :
if (sx1509io.digitalRead(0) == LOW) {
Serial.println("button1 pushed !!!");
}
The text was updated successfully, but these errors were encountered: