Releases: wollewald/MCP23017_WE
MCP23017_gpio_reading.ino example amended
The MCP23017_gpio_reading.ino example sketch might have been a bit confusing. I added a new sketch together with the wiring (Fritzing scheme).
Software reset added
I have added a function called softReset(). In init() the softReset() function will be called if the reset pin is >= 99. This is the case if you have the reset pin accordingly or if you don't pass a reset pin at all.
The softReset() function ensures that all registers are set to default.
ATtiny implementation and Init() has a return value now.
I have added the option to use an ATtiny in combination with the TinyWireM library from Adafruit.
And Init() has now a return value. True: MCP23017 is connected; False: MCP23017 is not Connected.
Library works now also with the MCP23018 and MCP23S18
The library works now also with the MCP23018 and MCP23S18. I have implemented constructors and added example sketches and circuits.
SAMD board compatibility improved and MCP23S17 class added
Binary numbers written like "B01110010" are depracated when using SAMD boards. I replaced them by "0b....", e.g. 0b01110010.
MCP23S17 ICs had been implented, but you had to use the MCP23017 class. I have now added a MCP23S17 class, which just inherits MCP23017 including constructors.
SPI clock rate can now be set
I added SPI.beginTransaction(SPISettings(clock,MSBFIRST, SPI_MODE0) / SPI.endTransaction(). The clock ist adjustable by a new public function:
setSPIClockSpeed(unsigned long clock);
Added another constructor
I added another constructor without parameter in order to be able to create arrays of MCP23017 objects like this:
MCP23017 myMCP[4];
Included the MCP23S17
With this release, you can control the MCP23S17. I have added an example sketch and the Fritzing scheme for the wiring.
Read performance increase
In the readMCP23017 function, I have added a "false" in Wire.endTransmission() ---> Wire.endTransmission(false) before Wire.requestFrom(). This saves some microseconds.
Implementation of INPUT_PULLUP
You can now choose INPUT_PULLUP as parameter in setPinMode.
You can also pull up input pins using the setPortMode function. You just have to add INPUT_PULLUP as additional parameter:
setPortMode ( value, port, INPUT_PULLUP )
-> input pins will be pulled up; no effect on output pins.