Hello,
I'm trying to use the MCP23S17 with my Arduino Uno board. I wired everything like this :
I wired a switch with pull-down 10K resistor on the GPB0 pin (Physically PIN 1 of the IC) which according to the document above is the input # 9.
I programmed a simple sketch for testing :
#include <SPI.h>
#include <MCP23S17.h>
MCP onechip(0);
int onevalue = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
onevalue = onechip.digitalRead(9);
if (onevalue = 1)
{
Serial.println ("ON");
}
else
{
Serial.printl ("OFF");
}
}
My problem is that the serial only shows "ON" from the begining disregarding the switch position. I can put out all the wires linking my Arduino to the breadboard nothing changes, always "ON" on the debug window. I tried to put pull-down resistors on available inputs, nothing changes, I checked my circuit many times, everything is like the document from Arduino Playground. I don't understand anything, could somebody help me please ?