Skip to content
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

Input is not working. Only output is working. #18

Open
Murugesh-Hobbyist opened this issue Jun 27, 2024 · 0 comments
Open

Input is not working. Only output is working. #18

Murugesh-Hobbyist opened this issue Jun 27, 2024 · 0 comments

Comments

@Murugesh-Hobbyist
Copy link

Murugesh-Hobbyist commented Jun 27, 2024

Hi firstly, your library is super. thanks for that.
I'm using ESP32 and have tried output with your library works great but it does takes the input.
Used the below code:

//---------------------------------------------------------------------------------------

#include <MCP23S17.h>
#ifdef PIC32MX
#include <DSPI.h>
DSPI0 SPI;
#else
#include <SPI.h>
#endif

const uint8_t targetPin = 15;
const uint8_t chipSelect = 10;
MCP23S17 Bank1(&SPI, chipSelect, 0);

void setup() {
Serial.begin(115200);
Bank1.begin();
delay(50);
for (int x = 0; x < 16; x++) {
Bank1.pinMode(x, INPUT_PULLUP);
}
}

void loop() {
for (int x = 0; x < 15; x++) {
Serial.print(Bank1.digitalRead(x));
Serial.print(" ");
}
Serial.println(Bank1.digitalRead(15));
}

//---------------------------------------------------------------------------------------

Expected output -> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Obtained result -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
also it doesn't detects any input high and lows.

Please help to fix it.

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