avishorp / TM1637

Arduino library for TM1637 (LED Driver)
GNU Lesser General Public License v3.0
427 stars 218 forks source link

support for mcp23017 #69

Closed thijstriemstra closed 3 years ago

thijstriemstra commented 4 years ago

Would be nice to be able to use this library with an MCP23017 expander. Something like https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library and a class where I can pass in the mcp instance that this library would call on instead of using the global pinMode. One of their examples:

Adafruit_MCP23017 mcp;

void setup() {  
  mcp.begin();      // use default address 0

  mcp.pinMode(0, INPUT);
  mcp.pullUp(0, HIGH);  // turn on a 100K pullup internally

  pinMode(13, OUTPUT);  // use the p13 LED as debugging
}

void loop() {
  // The LED will 'echo' the button
  digitalWrite(13, mcp.digitalRead(0));
}
avishorp commented 3 years ago

Unfortunately I don't have this kind of hardware, so I'm unable to test it.

thijstriemstra commented 3 years ago

@avishorp what if i order an mcp23017 for you? :)