yanbe / ssd1306-esp-idf-i2c

Sample code for driving 128x64 OLED display (SSD1306 driver) via ESP-IDF's I2C master driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"clear" clearly not working (at least for me) but I have a fix

SinanAkkoyun opened this issue · comments

commented

Hey, your clear function inits the zero[128] array but never defines it, which lead to artifacts on my display. Here is the primitive fix you could probably solve way better:

uint8_t zero[128];
for (uint8_t i = 0; i < 128; i++) {
zero[i] = 0;
}

commented

Memset is more concise :)

uint8_t zero[128];
memset(&zero,0,128);

even more concise

uint8_t zero[128] = {0};
commented

Thanks guys, appreciate it :D

Thanks.. i was wondering if its a bug hehe..