Hi Valecek,
here is some general info, look at Example 1: One Shift Register:
Arduino shifting

or here but for IC 74HC165, very similar like 4021:
74HC165

and look at this picture:


Good luck


Last edited by erichos; 12/14/16 11:10 PM.