Sylaina / oled-display

Library for OLED-displays runs on AVR
GNU General Public License v3.0
121 stars 29 forks source link

Draw functions not working #9

Closed guiosorio15 closed 1 year ago

guiosorio15 commented 1 year ago

Hi, I am trying to draw a simple circle on my sh1106 lcd. I have all the libraries working for text mode but the graphic mode is not working.

I also tried to use your example code but it only sends to the display: "Hello World", "String from flash". The circle don't show up

include "lcd.h"

int main(void){ lcd_init(LCD_DISP_ON); // init lcd and turn on

lcd_puts("Hello World"); // put string from RAM to display (TEXTMODE) or buffer (GRAPHICMODE) lcd_gotoxy(0,2); // set cursor to first column at line 3 lcd_puts_p(PSTR("String from flash")); // puts string form flash to display (TEXTMODE) or buffer (GRAPHICMODE)

if defined GRAPHICMODE

lcd_drawCircle(64,32,7,WHITE); // draw circle to buffer lcd_display(); // send buffer to display

endif

for(;;){ //main loop } return 0;

}

Here is an image: https://ibb.co/7YhHmNS

Hope you can help me :)

Sylaina commented 1 year ago

You have to edit lcd.h. Chance line 63 from '#define TEXTMODE' to '#define GRAPHICMODE' and graphicmode will work fine.