This is probably an easy question, but the lack of documentation and example of my use case is driving me crazy.
I have an Arduino Zero, and an ST7565 Graphic Display, connections are OK, and everything is working fine, I can run the examples and I see the graphic and text in the LCD. I am using the Adafruit ST7565 library in: GitHub - adafruit/ST7565-LCD: There are two 'versions' of the LCD library - one is straightup avr-gcc and the other is an Arduino Library. They're essentially the same. You can create new icons for bitmapdisplaying using bmp2glcd have fun! limor
My issue is related to my understanding of how the library works. I want to print 6 variables at different cursor positions. According my understanding with the documentation and the code browsing, there is a local framebuffer, where you call the "print" functions like drawCircle(), drawString(), and then you need to call the function glcd.display() to reflect the changes (frame buffer) in the physical display, i.e. to flush the local buffer to the physical display.
This is my code in the loop function:
// Analog Input Readings
int V1 = analogRead(V1Pin);
int V2 = analogRead(V2Pin);
int V3 = analogRead(V3Pin);
int I1 = analogRead(I1Pin);
int I2 = analogRead(I2Pin);
int I3 = analogRead(I3Pin);
// DISPLAY LCD ST9565 ---------------------------------------------
// Analog inputs print in the display (128x64)
glcd.clear();
char V1String[10]; // Space for 9 characters + null termination
sprintf(V1String, "V1: %d", V1);
glcd.drawstring(0, 0, V1String);
char I1String[10];
sprintf(I1String, "I1: %d", I1);
glcd.drawstring(64, 0, I1String);
char V2String[10];
sprintf(V2String, "V2: %d", V2);
glcd.drawstring(0, 16, V2String);
char I2String[10];
sprintf(I2String, "I2: %d", I2);
glcd.drawstring(64, 16, I2String);
char V3String[10];
sprintf(V3String, "V3: %d", V3);
glcd.drawstring(0, 32, V3String);
char I3String[10];
sprintf(I3String, "I3: %d", I3);
glcd.drawstring(64, 32, I3String);
glcd.display();
delay(1000);
However I am getting only the first row printed with two different analog variables (V1 and I1), the rest of the display is empty. How can this be?