hello i recently got some MAX23017 port expanders but i am having trouble controlling them. i know that there are 2 port on this IC and so far i have only been able to get the 0 output on port A to work using the adafruit library. How do i use this library to control the port expander (they only need to be outputs)?
i would like to be able to use these port expanders to control a BCD to decimal decoder (74141) to drive some IN-12 nixie tubes.
how would i use this library and if it cannot be done can it be done with the wire library?
Did you try setting the pin number to something other than 0 to try other pins? Here is the example code re-written to use Pin 15 instead of Pin 0
#include <Wire.h>
#include "Adafruit_MCP23017.h"
// Basic pin reading and pullup test for the MCP23017 I/O expander
// public domain!
// Connect pin #12 of the expander to Analog 5 (i2c clock)
// Connect pin #13 of the expander to Analog 4 (i2c data)
// Connect pins #15, 16 and 17 of the expander to ground (address selection)
// Connect pin #9 of the expander to 5V (power)
// Connect pin #10 of the expander to ground (common ground)
// Output #15 is on pin 8 so connect an LED or whatever from that to ground
Adafruit_MCP23017 mcp;
void setup() {
mcp.begin(); // use default address 0
mcp.pinMode(15, OUTPUT);
}
// flip the pin #15 up and down
void loop() {
delay(100);
mcp.digitalWrite(15, HIGH);
delay(100);
mcp.digitalWrite(15, LOW);
}
I do believe our resident expert and all round guru Nick Gammon has done some trials using this chip to interface to a LCD matrix display but I cannot remember where.