I notice the Mega shows the following assignments:
PA 0 = Pin22
PA 1 = Pin23
PA 2 = Pin24
....
PA 7 = Pin29
This seems to show that Port A (PA) is assigned the 8 pins from Pin22 to Pin29. In other micros, I could do something like...
digitalRead (PA, myInput)
So I would DEFINE myInput as a Byte, and "reading" PA says "Read the 8 pins I defined as Port A (22-29)"
I could then compare myInput with oldMyInput to check for a change.
Does Mega allow this? Can I lump 8-bits into a single 8-bit port and write it out in one command, or read in 8-bits of digital input and process them as a single byte???
I'm writing a digital game with 8 digital switch inputs and the logic will drive 8 LEDs using PWM, so the ability to "talk" using an entire byte instead of processing inputs and outputs on a bit-wise level, would be an advantage.