Problem with connecting an LCD 16x2

floresta:

I've found here datasheet:
http://www.geeetech.com/Documents/LCD1602%20White%20Datasheet.pdf
But i can't find what type of resistor i need.

That is not the datasheet for your LCD module but it looks fairly typical.

Look in the middle of page 6 in section 7. The nominal current for the LED is 110mA and with that current the voltage drop across the LED will be 4.2 Volts. Since you are using a 5 Volt supply the series resistor will have to drop 0.8 Volts. The required resistance is 0.8 V divided by 0.110 A which gives 7.27 Ohms. I would try a 10 Ohm resistor but you could probably use a much larger value and still have a usable amount of backlight.

Don

Using a diode is not that uncommon for that kind of voltage drop.

Using LEDs is a means of debugging, some people use a logic analyzer for this purpose.

One example, I use I2C, the code worked for one project but not for another. Using a piezo I quickly figured out the signals are emitted on the wrong pins (the project indeed used the I2C files from another directory, not the one's in the project directory).

Over the years you'd become familiar with debugging issues, I use MCUs since 2004.