Error on LCD 12864

Hello, I tried to run helloworld sketch to see if my LCD ST7920 12864 graphic display works. This is the error from terminal.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Failed uploading: uploading error: exit status 1

and this is whole sketch:

#include "Wire.h"
#include "I2C_LCD12864.h"

I2C_LCD12864 lcd(&Wire);

void setup()
{
Wire.begin();
lcd.init();
lcd.clear(0, 0);
lcd.clearBuffer();

lcd.setFont(z_font_5x8); 

lcd.drawText(1,50, "String ");
lcd.sendBuffer(); // push buffer data to CGRAM
lcd.setBL_on();
delay(2000);

}

void loop()
{
lcd.clear(0,0);
lcd.clearBuffer();
lcd.drawText(50,50, "HELLO WORD !");
lcd.sendBuffer();
return;
}

If you know what can it be I´ll be glad to hear your opinion.

Welcome to the forum

Which Arduino board are you using ?

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

In my experience this is the easiest way to tidy up the code and add the code tags

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

It looks like there is a problem with communication between your PC and Ardiino board.
Have you chosen the right serial port in the Tools ports menu?
Have you chosen the right board in the Tools menu?
Are you using a good DATA cable?
Have you tried the suggestions in the troubleshooting thread?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.