What exactly is PINB | = 0b00000001;

1. PINB is the symbolic name for all the pins of Port-B Register when its IO lines are configured to work as "input lines" (Fig-1).

PINB
Figure-1:

2. The following lines are valid codes (Edit: except (2), see Post-10):

(1)  byte y = PINB;    //reading input status of all port pins of Port-B Register
(2)  bool x = PINB0;   //reading 1-bit input value from Bit-0 of Port-B Register
(3)  bool x = digitalRead(8);    //same as (2) 

3. I personally do not like the following (though valid) code which writes on PINB; where, PINB is an input port. Traditionally, we write data onto an output port.

PINB = 0b00101010;       //?
1 Like