You are just writing the top four bits and then the lower four bits since you only have four wires.
CUR_HOME = 0x02 aka 0b 0000 0010
So first we set up :
DB7 = LOW, DB6 = LOW DB5 = LOW, DB4 = LOW (The High Nibble: 0000)
Then once we are sure that it is clocked in we can set up the Low Nibble:
DB7 = LOW, DB6 = LOW, DB5 = HIGH, DB4 = LOW (The Low Nibble: 0010)
So once that is clocked in the device knows that since it got two Nibbles and it is configured in 4-bit mode that it should reconstruct an 8 bit command by putting them together.
If it is the shift operator causing you trouble then let me try to explain what to expect given certain input:
The operators << and >> are bit-shift operators. They move the bits either left ( << ) or right ( >> ).
If a bit is “shifted out” of the value… the information is lost. Bits “shifted in” will be 0.
byte B = 0x20; // 0010 0000
byte ShiftedRightBy4 = B >> 4; // 0000 0010 - the one was shifted right 4 spaces. zeros filled in from the left.
byte C = 0x4F; // 0100 1111
byte ShiftedLeftBy5 = C << 5; // 1110 0000 - information that was shifted out is lost, zeros filled in from the right.