I am looking at the AT Mega chip for Leonardo (https://www.arduino.cc/en/Hacking/PinMapping32u4) and if I wanted to hookup a multiplexer to, say, Digital Pins 0 1 2 3, how do I cycle these ports in order when:
PD0 = Pin 3
PD1 = Pin 2
PD2 = Pin 0
PD3 = Pin 1
I have only used PORTB before, and PB0-3 corresponds directly to 8 - 11, in order.
Do I simply just hookup the multiplexer selectors in a different order? So 'S0' goes to Pin 3, 'S1' to Pin 2, and so forth.