Re: toggle switch wiring
Into the DIO (Digital Input-Output) port. These are SPST (single pole single throw switches)? You need to connect to the ground pin of the DIO port, corresponding to the black wire of a PWM cable and the outside pin of the DIO port. Either connector of the SPST can go to this pin. The remaing connector of the switch goes to the signal pin of the DIO port, which is the inside pin. That signal connection corresponds to the white wire of the PWM cable. DO NOT connect anything to the 5V (center pin) of the DIO port.
You don’t need the 5V pin because the signal pin has a weak (high resistance) voltage provided for just this purpose. In electronics parlance it’s “Pulled Up”.
BTW this is exactly how a limit switch is connected. A limit switch is not a special kind of switch, rather a switch we use for limiting the movement of an articulation on our ‘bots.