Getting Extra Outputs on the NodeMCU (ESP8266) With a 74HC595 Shift Register

I use the SPI port on the NodeMCU (ESP8266) development kit to drive a 74HC595 8-bit shift register IC. This technique can be used to get 8 outputs using just three GPIO pins on the ESP8266.

I show the breadboarded configuration, the circuit diagram, and the Lua code needed to drive the shift register.

The Lua code can be found here: