I'm attempting to use an Arduino Nano in a project where I need to read blocks of pins as quickly as possible. I know that for D0-D7 I should be able to read PIND. So in setup() I call the following to set all the pins in PIND to input:
DDRD = B00000000;
I then attempt to print PIND (along with doing a digitalRead(2)) in loop(). While that is running I use a jumper wire on my breadboard to either pull D2 to ground or to 5V. The digitalRead(2) call shows me the expected value on pin D2, but I see no changes reflected in PIND. Am I doing something obviously wrong? I used similar code on an Arduino Mega (with the appropriate PINx for that platform) and it works fine.
buttons are typically connected between the pin and ground, the pin configured as INPUT_PULLUP to use the internal pullup resistor which pulls the pin HIGH and when pressed, the button pulls the pin LOW.
Sorry, it was late and I rushed to post. My mistake, all, and I appologize for that. I ended up resolving my issue this morning. Not sure what I was doing wrong but I've gotten it working now.
Thanks to the several people who decided to pile on make snarky remarks about not having posted enough information after it was already pointed out several times before. Very helpful!
Seriously though, my mistake. Apologies all around.