Go Down

Topic: U8glib: Graphics Lib for LCDs and OLEDs (Read 224842 times) previous topic - next topic

cabecinhas




Using drawBox by changing its height on real-time makes its height increases from the Start position (y)  to the down and I wanted the option of when changing the height, the box increases its height from the start position to the top.. ..
Is there an option to do it or I will need to do by code?

Tks,  Oliver


Decrease y and increase height at the same time. This should do the job.

Oliver



Hi, Oliver.. Yes Worked like a charm! Perfect!

Just to finish(If I still can after lots of your help).... Could I change the z-index of a box?

I mean.. I need to write a "blank" text inside a "drawBox".. Is it possible?

Tks so much, Oliver.





olikraus

Hi

Quote
I mean.. I need to write a "blank" text inside a "drawBox".. Is it possible?

You can change the current "draw color":

setDefaultForegroundColor
drawBox
setDefaultBackgroundColor
drawStr
setDefaultForegroundColor

Oliver

cabecinhas

That worked again!

Are you the developer :) ?

The library is working perfectly..Just like the Fony Software... the only issue is the speed now.

I'm running it @ 3.3v/8Mhz

The screen refresh is only about 3Hz and sometimes a character seems to deform due to the low refresh speed.

Do you know if this issue is because bad constructor like? I have selected some and some seems to work and I took one that looked like a better one to use.

I'm Using this one:
U8GLIB_NHD_C12864_2X u8g(sock, mosi, cs, a0, reset);


If you know something I would be appreciated again.

Regards.

Rodrigo



olikraus

Hi

Yes, u8glib has been developed by me.
To some extend the speed can be influenced by the constructor and the _2X denotes already the faster constructor, which uses more RAM.

For further speed improvement, you need to optimize the "picture loop". The key adviceis: Do as much of the calculation outside the picture loop.

Instead of
Code: [Select]

  u8g.firstPage(); 
  do {
    a = 5;
    b = 3 * a;
    u8g.setFont(u8g_font_unifont);
    u8g.setPrintPos(0, 20);
    u8g.print(b);
  } while( u8g.nextPage() );

do this:
Code: [Select]

  a = 5;
  b = 3 * a;
  u8g.firstPage(); 
  do {
    u8g.setFont(u8g_font_unifont);
    u8g.setPrintPos(0, 20);
    u8g.print(b);
  } while( u8g.nextPage() );


You could post your u8glib related code and we can discuss optimization with your code.

Oliver

cabecinhas

Hi, Oliver. Everything is working greatly now!

Thank you so much.

Is your library donateware?

I want to contribute.

Tks

olikraus

Thanks for the feedback.

No donation required, U8glib is freeware.

Oliver

oldsergio

Hi

How must I setup the code to send a bitmap array for 4-bit pixel grayscale OLED.
As I see in the picture example there is only on or off pixels in the uint8_t picture array.


As I understand if I use drawBitmapP() it draws the byte of the uint8_t array  as a 4 bit value
for each bit. -> dark or light.

Is it possible to send byte by byte as they are in the array so I'll get the 4bit greyscales?

cabecinhas

ok. Oliver.

tks

Just one last question, maybe you can help me.

Is there a software where  I can import a bitmap/bmp and convert it into U8glib format?

Tks a lot, again.

Rodrigo

olikraus


Hi

How must I setup the code to send a bitmap array for 4-bit pixel grayscale OLED.
As I see in the picture example there is only on or off pixels in the uint8_t picture array.


As I understand if I use drawBitmapP() it draws the byte of the uint8_t array  as a 4 bit value
for each bit. -> dark or light.

Is it possible to send byte by byte as they are in the array so I'll get the 4bit greyscales?



Currently u8glib does not support bitmaps with two or four bits for graylevels.
Also: Only 2-bit modes (four graylevels) are available. In such a 2-but mode, use setColorIndex to set the graylevel.

Oliver

olikraus


ok. Oliver.

tks

Just one last question, maybe you can help me.

Is there a software where  I can import a bitmap/bmp and convert it into U8glib format?

Tks a lot, again.

Rodrigo


For example you can use "gimp" to export as XBM file. XBM is a plain text c code, which can be pasted into your code and is accepted by drawXBM procedure.

Oliver

Sozruh

Hello !

I own a EA DOGXL240W-7 and have search very hardly on the net how i can bring this lcd with the arduino mega to live.

Any path and informations are deeply appreciated.

Best Regards

Selim

olikraus

#251
Oct 18, 2014, 09:54 pm Last Edit: Oct 18, 2014, 09:58 pm by olikraus Reason: 1
Hi

There is some contributed code for the DOGM240. It can be used with the following constructors:
Code: [Select]
//U8GLIB_UC1611_DOGM240 u8g(U8G_I2C_OPT_NONE); // I2C
//U8GLIB_UC1611_DOGM240 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_UC1611_DOGM240 u8g(10, 9); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)

See also the HelloWorld example of the attached pre release.

My suggestion is this: Please check whether the DOGM240 is working for you. It will not be perfect, but maybe you can create and post a picture of the display. If it works (more or less), it can be extended to the DOGXL240.

Oliver

Sozruh

Thank you for the quick reply!

the XL240 datasheet shows no A0 pin. Any advice?

Best Regards

Selim

olikraus

A0 = CD

For SPI, use 4-wire SPI (BM0 = 0, D13 = 0). 3-wire SPI is not supported by U8glib.

Oliver

hatoupix

Hi,
sorry I'm a newbie ... I've read all of this thread ...  and a lot of other one !
I've trying to "switch on" my oled and wrtiing on it "hello world"

I've a chinese low cost oled SSD1306 and a nano
nano D5 on SLC oled
nano D4 on SDA oled

I've downloding the last u8glib (1.17pre4) ...
modifiy U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);   
or U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);


 the compilation is ok and transfert OK on nano ... but nothing else ! ...


thanks for your help,
Hatoupix (olivier)

Go Up