Skip to content

I can't get the SX1509 board to work with a ESP32-DevKitC V4 (WROOM 32U) #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
7heS4ge opened this issue Apr 10, 2025 · 0 comments
Open

Comments

@7heS4ge
Copy link

7heS4ge commented 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 !!!");
}

@7heS4ge 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant