Hello everyone!
Before explaining my silence these past few hours, I would like to announce that by using the suggestions from everyone, the MCP23017 chip is WORKING.
Here is my code (I combined it with a pushbutton-activated mode switching sketch to turn on or off an LED. It has the same wiring as the code @groundFungus supplied):
//----------------------------------------------------
#include<Wire.h>
#include<Adafruit_MCP23017.h>
Adafruit_MCP23017 mcp;
int mode = 0;
void setup() {
Serial.begin(9600);
Wire.begin();
mcp.begin();
mcp.pinMode(0,INPUT);
mcp.pullUp(0,HIGH);
mcp.pinMode(8,OUTPUT);
}
void loop() {
if(mcp.digitalRead(0) == 0){ //if the button has been pressed,
while(mcp.digitalRead(0)==0){} //loop nothing while it is being pressed
mode = mode + 1; //then add 1 mode to "mode" assuming that the button has been released (otherwise it would still be looping)
}
if(mode == 2){
mode = 0;
}
mcp.digitalWrite(8,mode);
if (mode==0){Serial.println("LOW (0v)");}
if (mode==1){Serial.println("HIGH (5v)");}
}
//----------------------------------------------------
Now, to explain:
I am so sorry, but as a new user, the forum stopped me from writing any more messages yesterday and even some of this morning. I had intended to tell everyone that all I could find was the OLD library, and the "Major Update" scrawled across the Github page made me think that Adafruit simply has not gotten to putting their new library on the manager. It said "last revision: 4 days ago" the last time I checked. I, personally, would not expect them to have the turn-around to make a change to a library and implement that change across the entire user community in just 4 days.
This is really important:
I did NOT download it directly from any website. I simply typed in the name of my MCP chip in the Library manager, found an Adafruit version (the same manufacturer as the one on the Github page), and downloaded it only from the Libraries Manager with no websites directly being used to aquire that specific library.
HOWEVER: I did use the same functions (along with the functions @groundFungus suggested) as the new library because I knew that it would not be very optimal for Adafruit if they had 2 seperate libraries. Because of this, I knew that the "Adafruit_MCP23017" library may terminate at any time. That is why, when or if the new version is available on the manager, (because we used the same functions), it should be able to work with the new library.
Just wanted to say thank you so much to @Koepel for the I2C scanner (helpful when using multiple I2C devices), @Grumpy_Mike for showing me how to wire a pushbutton with only 2 pins, and a special thanks to @groundFungus for the wiring of the chip as well as helping with details in the code (such as finding out that INPUT_PULLUP does not work).
Before clicking the "Solution" box, would it be ok if I were to type up a summary of what I found to be helpful in getting this chip to work?