Giter Site home page Giter Site logo

Make reset pin optional about mcp23017_we HOT 7 CLOSED

wollewald avatar wollewald commented on June 15, 2024
Make reset pin optional

from mcp23017_we.

Comments (7)

wollewald avatar wollewald commented on June 15, 2024

The reset function is only used by the Init function to ensure that the MCP23017 starts with a defined status. Otherwise, if you reset the ESP32, you might not reset the MCP23017. And then it could still "remember" its status before the ESP32 was reset and cause problems. And of course you need the reset pin if you want to use the reset function.

from mcp23017_we.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

But powering down the ESP32 and MCP23017 will reset the MCP23017 right? Unlike the ESP32 reset button?

from mcp23017_we.

wollewald avatar wollewald commented on June 15, 2024

Yes that's right.

from mcp23017_we.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

thanks!

from mcp23017_we.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

oh closed, too soon. For now I modified the library to not change the pinMode for the reset pin (e.g. when i pass in -1) but it would be nice to make the reset pin officially optional. So maybe the default should be -1 which indicates it's optional. I wouldn't change the examples, only add a note there saying it's optional.

I commented this out for now:

void MCP23017::Init(){
	//pinMode(resetPin, OUTPUT); 
	//reset();
	ioConA = B00000000;
        // etc..

from mcp23017_we.

wollewald avatar wollewald commented on June 15, 2024

Please try. You can use now:
MCP23017 myMCP(MCP_ADDRESS)
or
MCP23017 myMCP(MCP_ADDRESS, pinNumber)
All instructions in Init should ensure that the status of the MCP23017 is defined, even if not reset.

from mcp23017_we.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

awesome, thanks!

from mcp23017_we.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.