u8g2 icon indicating copy to clipboard operation
u8g2 copied to clipboard

The display shows lines at the top.

Open maurizioterreni opened this issue 6 months ago • 3 comments

I’m using an ST75256 JLX256160 module. When running a small test to check if the display works correctly, some lines appear at the top, as shown in the photo below. I’ve included the code listing. In your opinion, could this be a data-related issue, or is the display defective?

#include <Arduino.h> #include <U8g2lib.h> #include <SPI.h>

// Costruttore U8g2 per ST75256 (SPI, full buffer) // Sostituisci i pin con i tuoi se servono U8G2_ST75256_JLX256160_F_4W_HW_SPI u8g2( U8G2_R0, // Rotazione: 0°, puoi provare anche U8G2_R2 o altri 5, // CS 17, // DC 16 // RESET );

int contrast = 120; // Valore di contrasto iniziale (0–255) int direction = 1; // Direzione della variazione

void setup() { u8g2.begin(); u8g2.setFont(u8g2_font_ncenB14_tr); Serial.begin(115200); Serial.println("Test LCD ST75256 avviato...");

}

void loop() { // --- Test base del display --- u8g2.clearBuffer(); u8g2.drawStr(10, 30, "ESP32 + ST75256"); u8g2.setFont(u8g2_font_6x12_tr); u8g2.drawStr(10, 50, "Test di contrasto..."); u8g2.drawFrame(0, 0, 256, 160);

// Disegno un rettangolo animato static int posX = 0; posX = (posX + 5) % 256; u8g2.drawBox(posX, 70, 20, 20);

// Mostra il valore di contrasto char buf[32]; sprintf(buf, "Contrasto: %d", contrast); u8g2.drawStr(10, 100, buf);

u8g2.sendBuffer();

// --- Test variazione contrasto --- u8g2.setContrast(contrast); contrast += direction * 5; if (contrast >= 255 || contrast <= 0) { direction = -direction; // Inverti direzione }

delay(150); }

Image

maurizioterreni avatar Oct 12 '25 11:10 maurizioterreni

hmm... what confuses me is, that a constructor "U8G2_ST75256_JLX256160_F_1_4W_HW_SPI" does not exist in u8g2. How can your code work?

olikraus avatar Oct 12 '25 18:10 olikraus

Sorry i put the code with an error test I use this constructor U8G2_ST75256_JLX256160_F_4W_HW_SPI

maurizioterreni avatar Oct 12 '25 19:10 maurizioterreni

ah, ok... but yes, the upper lines look strange. Maybe you can retest this with some other examples like the FlipMode.ino Will the strange lines always appear at the same place, then it is most probably a broken display.

olikraus avatar Oct 12 '25 19:10 olikraus