PS. I was wrong about the mux ports all being enabled by default. According to the NXP PCA9548 datasheet, they are disabled by default (the port register value defaults to 0x00). The extra code I added to disable all eight ports first is actually redundant, but I’m going to leave it in there - just to show how to do it if you need to.