Go Down

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

Dj_Garfield

Thank you Oliver ( for the Font tips ), and Happy new Year to you , and all who read this topic :)
( I'm on the numeric font creation for my project , but the party for the new year's day was pretty hard :) )

olikraus

@Dj_Garfield: Good, but note that there is a size limitation for the glyphs. They can not be larger than about 48/49 pixel.

Oliver

Dj_Garfield

#182
Jan 03, 2014, 12:19 am Last Edit: Jan 06, 2014, 10:32 pm by Dj_Garfield Reason: 1
Ok , I keep this in mind , but The Font I expect to create , is 17 pixels Width x 24 pixels Height . Actualy I just test your tips by extracting only chars from 42 to 59 => just displaying time, but I need the ":" char in the font table :). and it works fine :)

I can do everything I need with the u8g lib , It is realy a wonderfull one , simple , as fast as the board could be .
I love it :)
==========================
Edit :
The Font I expect to create is the one who displays the speed as digit numbers in the middle of the screen, the truncated Helv font is used to display time , and odometer informations.

I have a mysterious issue with time displaying : when I put the code to display time on a 40x2 LCD the display is like that : 01:03:30 for example , but here with the 128x64 with the Helv Font I obtain for the same time :  1:3:30 there is no leading 0 .. and I dont know why ...

Edit 2 :

All Right , the font is made :) very simply , and is exactly what It was expected :) , Now I start from a scratch bdf File , I open it with FONY , and when done  : bdf2u8g and It works !:)

Edit 3:

For those who wants the font :
Code: [Select]

// FONT DS-DIGITAL NUMERIC ONLY
const u8g_fntpgm_uint8_t u8g_font_DSDGNUM[527] U8G_FONT_SECTION("u8g_font_DSDGNUM") = {
  0,16,30,0,251,24,0,0,0,0,48,57,0,25,0,24,
  0,14,24,48,16,1,1,127,248,191,244,223,236,224,28,224,
  28,224,28,224,28,224,28,224,28,192,12,128,4,0,0,128,
  4,192,12,224,28,224,28,224,28,224,28,224,28,224,28,224,
  28,223,236,191,244,127,248,3,24,24,16,12,1,32,96,224,
  224,224,224,224,224,224,224,96,32,0,32,96,224,224,224,224,
  224,224,224,96,32,14,24,48,16,1,1,255,248,127,244,63,
  236,0,28,0,28,0,28,0,28,0,28,0,28,31,236,63,
  244,127,248,191,240,192,0,224,0,224,0,224,0,224,0,224,
  0,224,0,224,0,223,224,191,240,127,248,13,24,48,16,2,
  1,255,240,127,232,63,216,0,56,0,56,0,56,0,56,0,
  56,0,56,63,216,127,232,255,240,127,232,0,24,0,56,0,
  56,0,56,0,56,0,56,0,56,0,56,63,216,127,232,255,
  240,14,22,44,16,1,2,128,4,192,12,224,28,224,28,224,
  28,224,28,224,28,224,28,223,236,191,244,127,248,31,244,0,
  12,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,
  12,0,4,14,24,48,16,1,1,127,248,191,240,223,224,224,
  0,224,0,224,0,224,0,224,0,224,0,223,224,191,240,127,
  248,63,244,0,12,0,28,0,28,0,28,0,28,0,28,0,
  28,0,28,31,236,63,244,127,248,14,24,48,16,1,1,127,
  248,191,240,223,224,224,0,224,0,224,0,224,0,224,0,224,
  0,223,224,191,240,127,248,191,244,192,12,224,28,224,28,224,
  28,224,28,224,28,224,28,224,28,223,236,191,244,127,248,13,
  23,46,16,2,2,255,240,127,232,63,216,0,56,0,56,0,
  56,0,56,0,56,0,24,0,8,0,0,0,8,0,24,0,
  56,0,56,0,56,0,56,0,56,0,56,0,56,0,56,0,
  24,0,8,14,24,48,16,1,1,127,248,191,244,223,236,224,
  28,224,28,224,28,224,28,224,28,224,28,223,236,191,244,127,
  248,191,244,192,12,224,28,224,28,224,28,224,28,224,28,224,
  28,224,28,223,236,191,244,127,248,14,24,48,16,1,1,127,
  248,191,244,223,236,224,28,224,28,224,28,224,28,224,28,224,
  28,223,236,191,244,127,248,63,244,0,12,0,28,0,28,0,
  28,0,28,0,28,0,28,0,28,31,236,63,244,127,248};


Below all the Files needed for the operation , if someone need some , It's free :)

LarsSorensen

I have a problem getting a SSD1306 128x64 OLED to work. It does not show anything.
The OLED works flawless using the Adafruit lib.
Using the u8glib and any example sketch, I cannot get it to work and I admit it might a case of identifying the correct pins.

The OLED I am trying to work with is this one:
http://www.ebay.com/itm/SPI-IIC-0-96-128X64-White-GreenLand-OLED-Display-Module-SSD1306-for-Arduino-AVR-/310740698356?pt=LH_DefaultDomain_0&hash=item485996c4f4

In the sketch I have uncommented  "U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9);"

In the attached picture I have tried to identify the different pins and functions of the board vs Adafruit lib and U8GLIB.
The connections I am most unsure of is MOSI and A0.



Reading the U8G device documentation an comparing it to Adafruit and OLED documentation it seems as MOSI should be connected from the D1 pin on the OLED to PIN 11 on the arduino boardm and a0 should be connected from the DC PIN on the OLED to PIN 9 on the Arduino board.
However it is not working, and I have tried to identify the pins on the OLED according to the U8GLIB terminology, but nothing works. Even when I sporadically move around the connectors on the OLED ;)

Anyway, I hope someone can shed some light on this.

- Lars

olikraus

With the SW SPI constructor
U8GLIB_SSD1306_128X64(sck, mosi, cs, a0 [, reset])
you can use any Arduino pin. For example
U8GLIB_SSD1306_128X64(1,2,3,4)
tells U8glib, that the sck line of the display is connected to pin 1 of the Arduino board, MOSI (data) line is connected to pin 2 of the Arduino and so on. In fact you can mimic the Adafruit setup with U8glib (pin values from your table):
U8GLIB_SSD1306_128X64(10, 9, 12, 11, 13)

Also ensure, that your display is put into serial mode.

Oliver



richardtheboffin

Just to confirm when using U8glib on Arduino, it's a Software SPI and can therefore use any pins?

olikraus

U8glib supports SW SPI (with any pins), but also HW SPI.

Oliver

richardtheboffin

So it uses HW SPI if you define the HW SPI pins in the setup function?

olikraus


So it uses HW SPI if you define the HW SPI pins in the setup function?


The opposite is true, see page http://code.google.com/p/u8glib/wiki/device.

Text copy from there:
Code: [Select]
SW SPI u8g_dev_st7565_64128n_sw_spi U8GLIB_64128N(sck, mosi, cs, a0 [, reset])
HW SPI u8g_dev_st7565_64128n_hw_spi U8GLIB_64128N(cs, a0 [, reset])



Oliver

timofteandrei

Have anyone tried to use this lib with Nokia 7110 display? It doesn't work for me and I've tried few configurations for different so-called compatible displays, but didn't work. I need help because I have 3 lcd displays collected from some 7110 phones. Thanks!

olikraus

Which constructors did you use? The display should be compatible with the ST7565 controller.

Oliver

LarsSorensen


In fact you can mimic the Adafruit setup with U8glib (pin values from your table):
U8GLIB_SSD1306_128X64(10, 9, 12, 11, 13)
Also ensure, that your display is put into serial mode.
Oliver


Thank you!

Actually, I DID try to mimic the Adafruit example without luck - Thanks to your suggestion, I noticed that I had lacked the RESET PIN - which I did not read about in the documentation.
Thank you very much for a fabulous library and your devoted help to people using your library.

- Lars

olikraus

@Lars
Glad to read that your display works.

Oliver

olikraus

U8glib (http://code.google.com/p/u8glib/) version v1.15 is available for download.

Google finally had stopped any new downloads. I had to remove the tab on the google code project page. Please download U8glib from here: https://bintray.com/olikraus/u8glib/Arduino

The new release includes (together with some bug fixes) the following new features:

  • ProFont family of fonts

  • drawTriangle

  • Support for the UC1608 controller (240x64 pixel)



ProFont comes with several sizes and is very readable


"drawTriangle" draws a filled triangle:


The UC1608 is a modern controller for large COG displays:


Oliver

oscar0226

Hi I am trying to show 2 plots in the same loop on a LCD by using the U8glib library but it fails.

The reason that the plots has to be presented sequentially in the same loop is I am showing an averaged value and FFT result from an analog pin, and whenever the loop update it would pick a new measurement.  

I was trying to write the program as the way below, however, it is apparently one of the programming restriction in the library and I would like to ask how can I do the same thing without updating to the new loop?

Code: [Select]

show plot A
delay 5s
show plot B


Information of LCD and library can be found below:
Used LCD: LM6059, 128x64, Adafruit
Controller: ST7565
GLib:  U8glib

Many thanks!

Go Up