Stardate 98788.27

Day 5 trapped in my broken spaceship.   I managed to cascade two SN74HC595 SIPO modules together to get 16 lights working front to back.   The I2C computer is functioning. 

I placed two 100μf capacitors on the 5V power bus just outside the 5V connections of slave 1 and 4 to clean up the DC power. 

7 connections to Slave 1 for SN74HC165 and SN74HC595.  16 dip switches going to 16 LEDs.  So 7 connections controls 32 things.

The two SN74HC595N SIPO Shift Registers are cascaded together. 

Master  –  Slave HC74HC595N
Pin 9 to pin 13: Black
Pin 11 to pin 11: Blue:
Pin 12 to pin 12: White

Grounds and 5V are on the same buses. 

I found in the back of the ship some 8 dip switches and SN74HC165 PISO shift registers.  In order to save power in the ship, I connected each LED to a dip switch.

Dip switch 1 : front Red LED
Dip switch 2: front Blue LED

Dip switch 8: back Green LED

SN74HC165
A : switch 8
B:  switch 7
C: switch 6
D: switch 5
E: switch 4
F: switch 3
G: switch 2
H: switch 1

Both of the SN74HC595 and SN74HC165 are cascaded so it was a 16 bit Byte.  

SH74HC165 to Arduino
Pin 1 to Pin 7
Pin 2 to Pin 6
Pin 7 to Pin 5
Pin 15 to Pin 4

Master Arduino to Slave Arduino
Pin 10 to Pin 9

SN74HC165
A : switch 8
B:  switch 7
C: switch 6
D: switch 5
E: switch 4
F: switch 3
G: switch 2
H: switch 1

switch

Updated code: