Skip to content

Commit dcc0ec3

Browse files
committed
fix #46, setAddress() + setWire()
1 parent 273cd3b commit dcc0ec3

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.9.1] - 2025-03-06
10+
- fix #46, add **setAddress()** and **setWire()**
11+
912
## [0.9.0] - 2025-02-18
1013
- fix #44, add function to reverse the byte order of the 16 bit API.
1114
- update readme.md

MCP23017.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: MCP23017.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.9.0
4+
// VERSION: 0.9.1
55
// PURPOSE: Arduino library for I2C MCP23017 16 channel port expander
66
// DATE: 2019-10-12
77
// URL: https://github.com/RobTillaart/MCP23017_RT
@@ -101,7 +101,7 @@ bool MCP23017::pinMode1(uint8_t pin, uint8_t mode)
101101
// only work with valid
102102
if ((mode == INPUT) || (mode == INPUT_PULLUP))
103103
{
104-
// REV D
104+
// REV D
105105
// if (pin == 7) return false;
106106
val |= mask;
107107
}

MCP23017.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: MCP23017.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.9.0
5+
// VERSION: 0.9.1
66
// PURPOSE: Arduino library for I2C MCP23017 16 channel port expander
77
// DATE: 2019-10-12
88
// URL: https://github.com/RobTillaart/MCP23017_RT
@@ -16,7 +16,7 @@
1616
#include "MCP23x17_registers.h"
1717

1818

19-
#define MCP23017_LIB_VERSION (F("0.9.0"))
19+
#define MCP23017_LIB_VERSION (F("0.9.1"))
2020

2121
#define MCP23017_OK 0x00
2222
#define MCP23017_PIN_ERROR 0x81
@@ -36,10 +36,15 @@ class MCP23017
3636
bool isConnected();
3737
uint8_t getAddress();
3838

39+
// Patch #46
40+
void setAddress(uint8_t address) { _address = address; };
41+
void setWire(TwoWire *wire) {_wire = wire; };
42+
43+
3944
// Fix #44, reverse the byte order of the 16 bit API.
4045
// reverse == false ==> backwards compatible (default)
4146
// reverse == true ==> swaps the A and B byte to be more intuitive.
42-
void reverse16ByteOrder(bool reverse = false);
47+
void reverse16ByteOrder(bool reverse = false);
4348

4449

4550
// single pin interface

keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ MCP23017 KEYWORD1
88
begin KEYWORD2
99
isConnected KEYWORD2
1010
getAddress KEYWORD2
11+
setAddress KEYWORD2
12+
setWire KEYWORD2
1113

1214
reverse16ByteOrder KEYWORD2
1315

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/MCP23017_RT.git"
1717
},
18-
"version": "0.9.0",
18+
"version": "0.9.1",
1919
"license": "MIT",
2020
"frameworks": "*",
2121
"platforms": "*",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=MCP23017_RT
2-
version=0.9.0
2+
version=0.9.1
33
author=Rob Tillaart <rob.tillaart@gmail.com>
44
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
55
sentence=Arduino library for I2C MCP23017 16 channel port expander 16 IO-lines

0 commit comments

Comments
 (0)