adafruit / adafruit/Adafruit-MCP23017-Arduino-Library
Setting (digitalWrite) pin y, unsets pin x
- Dominant language
- C++
- Stars
- 385
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
- Arduino board: Custom board
- Arduino IDE version (found in Arduino -> About Arduino menu): PlatformIO
- List the steps to reproduce the problem below:
Run below sketch, it is expected that pin5 is toggling every 2 seconds.
It will however prematurely turn off setting another pin.
```
#include
#include
Adafruit_MCP23X08 mcp;
TwoWire my_wire(0);
void setup()
{
Serial.begin(460800);
my_wire.setPins(5,6);
mcp.begin_I2C(0x27, &my_wire);
mcp.pinMode(5, OUTPUT);
mcp.pinMode(6, OUTPUT);
}
void loop()
{
delay(2000);
digitalWrite(1, HIGH);
mcp.digitalWrite(6,LOW);
delay(2000);
digitalWrite(1, LOW);
mcp.digitalWrite(6,HIGH);
mcp.digitalWrite(5,HIGH); //This write also sets pin6 low ???
delay(50);
mcp.digitalWrite(5,LOW);
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the provided sketch and reproduce the interaction between digitalWrite(1) and Adafruit_MCP23X08::digitalWrite(5,6). Read the library implementation and its pinMode/state handling to determine why writing pin 5 changes pin 6. Done means the reproduction no longer changes pin 6 unexpectedly, with the behavior verified on the reported setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100