How can I read this digital pin for Nano by using AVR's Atmel Studo?
Read the port state with PIND
Isolate the bit you want with &amp;
Profit


if (PIND &amp; 0b0100000) {
    val |= 1;
}


Or, as a ternary:

val |= ((PIND &amp; 0b01000000) ? 1 : 0);