I am getting blocks on my lcd screen 16*2
There are two possible problems, and you haven't stated which it is.


A single row of blocks (just the top row)


This is caused by either bad communication (wrong wiring) or incorrect code. Basically, the display isn't being initialized properly by your code for whatever reason.


Two rows of blocks (the entire display full of blocks)


The display is being initialized properly, so both your code and wiring are correct.  However, the contrast setting of the display is wrong. You need to check the wiring for your contrast potentiometer and adjust as necessary.