but if i use the Library “LCD12864”, I will get the Error code “#include <wiring.h> ← compilation terminated” back.
And I have one more question. On my LCD, there are the Pins “PSB” , “NC” , “RST”, “V0” and “Vout”. How should I connect them with my Arduino Mega.
I would abandon using LCD12864 as the tutorial is not well written and is not consistent so success is unlikely.
u8glib is a better option but most tutorials on the web seemed to be focused on the software and not how to connect things up, which is not very helpful to a newbie >:(
PSB is parallel/serial select. Check it is not already defined on the back of the PCB, if there are no components or solder blobs on the 3 pads between P and S on the PCB then you can wire it low for serial interface mode(SPI) or high for parallel 4/8 bit mode.
NC= no connect
RST = reset, normally this is pulsed low after power up by the library, some displays have a reset circuit on the PCB and so this line does not need to be connected, to be safe connect it up to a pin.
Vout is a bias output pin that typically sits at 7V, it is used to bias the contrast pin V0. Typically a 10K pot is connected from Vout to 5V and the pot slider goes to V0. Adjust the pot to get good contrast. You may need to connect the pot from Vout to 0V and then the slider to V0, so try that if you cannot get the contrast set properly.
P.S just found this thread that looks promising.