Additional Information
Do note that when connecting the output port to an inductive load, it is recommended to add a flyback diode to the connection as below.
Since an inductive load cannot change its current instantly, the flyback diode provides a path for the current when the output ports are set to High. Otherwise, a voltage spike will occur causing arcing on switch contacts or possibly destroying the load.