Go Down

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

Raphango


Yes, the listing file would be nice to see.
Depending on the fonts U8glib requires about 10K. If you do not need ASCII chars with code higher than 127, then fonts with a "r" postfix can be used to reduce flash memory.
Also other libraries and the use of floating point are common reasons for increased memory usage.

Oliver


Do you think doing this procedure would help me to reduce the size to possibly upload the code to an ATtiny85? If so, how can I do this procedure?

Thanks in advance! =D

olikraus

In the HelloWorld example, line 130, replace
Code: [Select]
u8g.setFont(u8g_font_unifont);

with
Code: [Select]
u8g.setFont(u8g_font_unifontr);

Try to upload this example. If you get the same errors, then u8glib might be to big for the Attiny85.

Oliver

Raphango

Thanks for the "r"!!

I tried to compile (just compile, Ctrl + R) the "Hello World" from the u8glib and i get the following results, according to the board i've choosen:

Board:::::::::::::Result
Arduino Uno: Compiling successful
Arduino Nano w/ ATMega328: Compiling successful
ATtiny85 (internal 1 MHZ clock):
Code: [Select]
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o: In function `__vector_default':
(.vectors+0xa): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_5' defined in .text.__vector_5 section in core.a(wiring.c.o)
core.a(main.cpp.o): In function `main':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:15: relocation truncated to fit: R_AVR_13_PCREL against undefined symbol `serialEventRun()'

ATtiny85 (internal 8 MHZ clock):
Code: [Select]
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o: In function `__vector_default':
(.vectors+0xa): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_5' defined in .text.__vector_5 section in core.a(wiring.c.o)
core.a(main.cpp.o): In function `main':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:15: relocation truncated to fit: R_AVR_13_PCREL against undefined symbol `serialEventRun()'


I have followed this tutorial to use my Arduino as ISP for the ATtiny: http://highlowtech.org/?p=1695

Thanks again!

olikraus

Hi

Somehow the error messages sounds like, that the sketch is still to big. But again, i am not an expert for the Attiny45. It seems to be more often discussed in " Arduino Forum :: Using Arduino :: Microcontrollers".

Oliver

Raphango


card5

#230
Sep 15, 2014, 07:51 pm Last Edit: Sep 15, 2014, 07:53 pm by card5 Reason: 1
Hi


Amazing Library, I am using it with a small OLED display I bought from eBay:
http://www.ebay.com/itm/121288137874

I chose U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE) and it works perfectly.


Thank you for creating it.


May I ask you,
the webstore ElectroDragon sells 2 LCD-TFT Displays:




http://www.electrodragon.com/?product=eds-tft-lcd-lcm-spi-interface-variable1-82-2



The left one is 1.8",
the right one is 2.2".


I bought the 1.8" one, and according to their Wiki page, it is based on ST7735S.
http://www.electrodragon.com/w/EDS_TFT_LCD_LCM_SPI_Interface


Does U8glib support that display too?

From the list of classes, I did not find that chip,
but maybe it's another name?


Thank you

olikraus

Hi

Thanks.

The question regarding color displays  came up very often. I finally decided to split off color displays and created Ucglib: https://code.google.com/p/ucglib/.

It has some small differences: I removed the "picture loop" (because it does not make sense for color TFTs/OLEDs), added true color support to all graphics primitives and updated the fonts a little bit (actually i replaced one of the fonts with another font).

Ucglib has its own thread here: http://forum.arduino.cc/index.php?topic=214966.0

Ucglib is quite young and it does not have the popularity as UTFT or the Adafruit Lib, But Ucglib is infact U8glib for color displays, especially for those users, who do not want to miss a large collection of fonts and an online documentation.

Oliver




card5

Great,
I will wait for the display from ElectroDragon to arrive, and then use Ucglib.

Thank you for creating them :)

fahad1

Hi Olikraus and Community,
could you guys look at my thread and help me out with some connections at the following thread
http://forum.arduino.cc/index.php?topic=267860.0

the module used is UC1610B i hope that is same as UC1610.

cabecinhas


Hi

Nice work. Glad to see that u8glib is usefull for you.

The U8glib font format not only contains the bitmat data but also a lot of glyph information for precise font rendering (mainly used for my other lib m2tklib). Some information available in the fonts are described here: http://code.google.com/p/u8glib/wiki/tstring.
The U8glib font format also tries to crop the bitmap data to save as much ROM as possible. All the glyph metric calculation, the bitmap reduction and the font encoding is done by an external program: http://code.google.com/p/u8glib/source/browse/tools/font/bdf2u8g/bdf2u8g.c. Simply compile the c-file with a unix or windows c-compiler (or send me a PM if you need the executable).

bdf2u8g requires a font in the bdf format: http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format

On the internet several fonts are available as bdf files, see for example here: http://cgit.freedesktop.org/xorg/font/

But it is also possible to convert truetype fonts (ttf) to bdf: I have used http://sofia.nmsu.edu/~mleisher/Software/otf2bdf/ and http://fontforge.org/. I am sure there are more tools (google has some 100.000 hits for "ttf bdf").

Oliver







Hi Oliver.. I'm trying and following your posts about how to create custom fonts.. But didn't get anywhere :( !

I Decided(reading yur answers) the best thing to do is create my own font..(AM I RIGHT?)

So I think the solution is create my own BDF fonts.. and then convert using bdf2u8g.exe to the library. Am I Right?

If I'm right, could you give me a clue about how to start creating my BDF files?

TKS SO MUCH!


olikraus

I think your are right with your assumptions.

Currently the simplest way to create a new font is this:
Use fony (http://hukka.ncn.fi/?fony), a font editor where you can save the font as .bdf file. Then use bsf2u8g to create the binary font for u8glib.

Oliver

cabecinhas

#236
Sep 30, 2014, 01:26 am Last Edit: Sep 30, 2014, 04:03 am by cabecinhas Reason: 1
Hi Oliver.. that's what I was looking for! I'll make a donation  because It helped me a lot(just like you did)

If you had an account I would "donate" to you as well lol..

I don't know if you have used the u8g.drawBox



I'm using it from the middle of the display so the bar can grow to bottom and to top of the display.

The problem is that the bar only "grows" in direction of bottom .

Do you know if there is a way to make it grow(increase its height) from the middle of display  to the top too?

Thank you so much again, Oliver!

Rodrigo



olikraus


Quote
I don't know if you have used the u8g.drawBox

I'm using it from the middle of the display so the bar can grow to bottom and to top of the display.

The problem is that the bar only "grows" in direction of bottom .


I guess this is a programming problem, not a problem of drawBox(). Can you post your code?

Oliver

cabecinhas

Hi,  Oliver.

Actually I don't think it's a Problem. It's a characteristic of u8glib..

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

olikraus



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

Go Up