ESP8266-01 and MCP23017 port expander

Pete:

It seems my challenge is mostly in re-identifying former GPIO’s from a LOLIN D1 mini pro, to proper “pin” naming for the MCP23017.

My modified code attempts to follow (closely at least) your conventions where declaring the “mcp” and associated output(s) only to :

mcp_pin_PA0 , mcp_pin_PA1, mcp_pin_PA2 , mcp_pin_PA3

Wherein formerly with D1 mini:

byte switch_pins[] = {12 , 13 , 14 , 15}; // number of gpio to be used as switch/relay control

Then following, to replace all instances of the numbers called in the coding to; “12 > mcp_pin_PA0, … , etc”.

It just doesn’t change the state of any of the outputs of the MCP23017 with a BLYNK command previously associated in code with a GPIO (ex. 12, V20)

Example from lines 374-376:

// set switch state from APP
BLYNK_WRITE(V20) {
turn_on_off(param.asInt(), mcp_pin_PA0, TIME_CNT);