Hello guys,
I am using ST7920 graphics display with i2c adapter. I am using a gammon I2C_graphical_LCD_display library. I have tried to make a simple "Hello world" code. But I am stuck in the beginning. When I upload the code, on the display appears only chaos dots, pics attached.
I solder i2c adapter on my own, but it should be correct. Dots appears after command lcd.begin().
Do you have any idea what is wrong? Thank you!
Here is code:
#include <Wire.h>
#include <SPI.h>
#include <I2C_graphical_LCD_display.h>
I2C_graphical_LCD_display lcd;
void setup ()
{
lcd.begin();
lcd.gotoxy (20, 40);
lcd.string ("Hello, world!");
}
void loop ()
{}
Hi , do you connect the pin PSB to GND??
I am gobsmacked.
ST7920 SPI interface uses 3 GPIO pins.
Backpack I2C interface uses 2 GPIO pins.
If you already have other devices on the SPI bus, an extra device costs 1 GPIO pins
If you already have other devices on the I2C bus, an extra device costs 0 GPIO pins
Yes, you can run a ST7920 with an I2C backpack. It will be very SLOW. I doubt if there is software to support it. It should be possible to use a PCF8574 backpack too. Again you would need software.
If you use the native SPI interface you have a choice of several Arduino libraries e.g. U8g2lib
And it will be supported by MBED and many other systems.
I Googled "Robotdyn I2C" and see that your backpack is advertised as Graphic LCD 12864 Adapter.
It is almost as expensive as the GLCD module.
David.
Hi,
thank you! I solved this as David said. It works fine without i2c and takes only 3 GPIO pins.
a