https://github.com/thejpster/Mcp23s17
in this project:
viewtopic.php?f=29&t=6069#p31719
.. it's big, you have to search for:
#include <Mcp23s17.h>
#define MCP23S17_SLAVE_SELECT_PIN 2
MCP23S17 Mcp23s17_1 = MCP23S17(MCP23S17_SLAVE_SELECT_PIN,0x1);
Mcp23s17_1.pinMode(OUTPUT);
// Cycle the output lines at a staggered rate, pin/2 milliseconds
long timeoutInterval = 1;
long previousMillis = 0;
uint16_t counter = 0x0000;
void timeout()
{
Mcp23s17_1.port(counter++);
}
(.. it's an old project. Today I would place most in SPIFFS ..)