direct manipulation pins

When doing direct port manipulation, is it better to access the (e.g.) PORTB6 register, or is it better to access the PORTB register and do bitwise operators to read bit 6? Which is faster?

There is no PORTB6 register.

That leaves accessing PORTB and doing bitwise manipulations to read bit 6:

if (PINB & (1<<6)) {
  // bit is high
} else {
  // bit is low
}

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

if (PINB & (1<<6)) {

I wouldn't have thought to do it in that particular way. Thanks! :slight_smile: