Hey GolamMostafa,
I exchanged one by one each element of my setup (board, wires, breadboard, sensor, LCD) and the error was always there. So I can conclude that all my elements (board, wires, breadboard, sensor, LCD) are working fine.
Since the code is correct, my assumption is that I probably didn't wire the LCD correctly.
Can you tell me how your LCD is wired?
Mine is as follows:
VSS => - on breadboard
VDD => + on breadboard
V0 => pin 6 (contrast)
RS => pin 12
RW => - on breadboard
E => pin 11
D4 => pin 5
D5 => pin 4
D6 => pin 3
D7 => pin 2
A => pin 10 (brightness)
K => - on breadboard
thanks