Skip to content

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

Description

@Murugesh-Hobbyist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions