Reading an IO register and doing a byte operation

With an Arduino UNO R3, I was wanting to monitor 3 different inputs on 3 pins. With an interrupt I would have the ISR use a switch statement to call different functions.

I wanted to read a port register (Port B?) and using byte (low or high) read the value and use that for the cases.

My question is how do I read a port IO register and not just a pin read

Welcome to the forum

This may be of interest https://docs.arduino.cc/retired/hacking/software/PortManipulation/

Followed by this https://docs.arduino.cc/learn/programming/bit-math/

This is the only reference on that page to reading an input register...

PIND is the input register variable It will read all of the digital input pins at the same time.

A long lively topic on the Forum about your very question:

Which page are you referring to ?

https://docs.arduino.cc/retired/hacking/software/PortManipulation/

(sorry.... your second post was not up when I started to post...)

PINB is the name of the Port B input register, here I assign it to the new variable bInputs:

unsigned char bInputs = PINB;

but until you present some code, I remain unconvinced that you need to use interrupts.

And reading the entire port at a time is fun, but this, too, is not usually terribly necessary.

Both choices will make your code harder to understand, probably, until we see what you doing.

a7

Understood

I realised after posting the first link that although it mentioned the registers there was no detail on how to read individual bits. I considered editing the post to add the second link but you never know whether someone has already read a post so decided to add a second one