I got interested in Arduino for the purpose of extending the sensor reach of my Raspberry Pi. I have 4 working Arduino Nanos (see post 35). And I have 9 Particle Photons. The built-in wifi/cloud really extends things. I've had 2 Photons doing "actual work" since summer 2015.
I've discussed relays in earlier posts, but I keep learning more. I used 4 relays to swap cold/heat on a Peltier device. Now I need to switch polarity on 2 motors using a single Particle Photon. However, the Photon only has 8 digital GPIOs. My 4-relay plan would use all of them. So I asked around and came up with this arrangement:
This wiring works and takes only 2 GPIOs per motor. I tested with a multimeter. Here's a bit of code: