Show Posts
Pages: 1 ... 30 31 [32] 33 34 ... 102
466  Using Arduino / Displays / Re: My GLCD code/hookup from arduino examples doesn't display text. on: January 03, 2014, 03:17:18 am
Quick Hardware review:

Do not use a variable resistor for the backlight. Variable resistors (usually) can not handle the current and the risk of accidently destroying the backlight is high. Depending the current (which i did not found in the data sheet) the constant resistor value is:
r = (5V-4.1V) / current_in_A

The contrast variable resistor is connected wrong in the Fritzing picture. See the datasheet of your post on page 9: I think the third pin of the variable resistor must be connected to ground.

From a software perspective, you might consider

467  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: January 02, 2014, 03:36:14 pm
@Dj_Garfield: Good, but note that there is a size limitation for the glyphs. They can not be larger than about 48/49 pixel.

468  Using Arduino / Displays / Re: st7920 lcd12864 glcd on: January 01, 2014, 11:08:43 am
But i don't understan why i need to do this
This is a FAQ.I tried to explain this here:

In my  sketch after some seconds i want check an input and i need to draw another line without clean the screen.
As explained in the link above, this can not be done with U8glib. You need to redraw the first line also.
Usually this is solved by an additional variable:

int is_second_line = 0;
void draw(void)
  // draw first line
 if ( is_second_line != 0 )
    // draw second line
As soon as you set the variable "is_second_line" to an nonezero value, both lines will be drawn.

469  Using Arduino / Displays / Re: T6963C (240x128) + U8glib on: January 01, 2014, 10:08:23 am

Is this the same display as mention here
Did you solve all problems? What had been the problems? How did you solve the FS1/FS2 issue?

470  Using Arduino / Displays / Re: st7920 lcd12864 glcd on: January 01, 2014, 09:58:40 am
Happy New Year!

U8glib is a little bit special. Graphics commands, need to be part of the "picture loop":

void loop(void) {
  do {
    u8g.drawHLine(20, 50, 47);
    u8g.drawVLine(58, 50, 12);
  } while( u8g.nextPage() );

See also

471  International / Deutsch / Re: U8glib Display on: January 01, 2014, 03:06:10 am

U8glib funktioniert etwas anders: Man muß die Graphik-Befehle immer in eine Schleife (picture loop) einbetten. Das sieht dann so aus:
#include <U8glib.h>
U8GLIB_KS0108_128 u8g(22,23,24,25,26,27,28,29,37,33,34,36,35); // 8Bit Com: D0..D7: 22,23,24,25,26,27,28,29 en=37, cs1=33, cs2=34, di=36, rw=35
int analogPin = 0;
int val = 0;

void setup() {

void loop() {
  val = analogRead(analogPin);
  do {
  } while( u8g.nextPage() );
Über diese Methode spart man sich,  bei gleichzeitiger Vermeidung eines kompletten Framebuffers im Ram, den Lesezugriff auf das Display. Das ist für ein KS0108 oder ein T6962 Display wegen des 8-Bit Interfaces nicht relevant, ist aber sehr hilfreich für Display-Controller mit SPI, die nur schreibenden Zugriff erlauben (ST7565, ST7920, SSD1306, UC1608, ...)

Siehe auch hier:

472  Using Arduino / Displays / Re: st7920 lcd12864 glcd on: December 31, 2013, 08:19:15 pm
Maybe you could post your code and the exact error you get with U8glib.

473  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: December 29, 2013, 03:37:56 pm
It took some time to reproduce the problem,  but indeed, this is a bug: Attaching two ST7920 displays with SW SPI does not work correctly. I have fixed this in v1.15pre3 of U8glib (attached...).

@boomych: Thank you very much for the bug report (karma+). I hope that this is now fixed.

474  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: December 28, 2013, 05:14:17 am
To be honest, i do not have an idea why this does not work. From U8glib perspective it should work. The only issue could be, that the same buffer is used if the same constructure is called. However, it seems, that this does not make a difference.
Can you ensure that youre code works correctly?
Maybe you should do a simple test script first. Pseudo code:

int cnt = 0;
void loop(void)  {
  print "cnt" on first display
  print "cnt" on second display

Now, even numbers (0, 2, 4, 6, ...) should be printed on the first display and odd numbers (1, 3, 5, ...) are printed on the second display. Will this work?

475  Using Arduino / Displays / Re: teensy 3.0 with teensyduino and u8glib on: December 27, 2013, 07:18:30 pm
Hi Bill

Good question.
First, my previous suggestion to use the arm variant for the Teensy is not that good, because the arm variant of u8glib does not contain the C++ interface.

And this is already the main difference between the Arduino and ARM variant: The Arduino code has the C++ interface, the ARM variant only has the C interface. Additionally the ARM variant is more generic than the Arduino variant. The base part of the library does not contain any micro-controller specific code. Infact the arm variant of u8glib should be renamed to "u8glib_generic".

Why can't the code compile time detect the processor, board, & environment and just "make it work"?
Processor detection is already inside the code.

u8glib arm variant: C++ is missing but clear instructions for porting to new environments are there
u8glib Arduino variant: C++ interface included, but porting is more complicated and not described very well

... i probably need a teensy 3.0 in my hands...

476  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: December 27, 2013, 07:03:30 pm
What i can say, is that two displays at the same time is not testes very well.
Can you replace one of the constructors with the 1x variant. For example
U8GLIB_ST7920_128X64_4X    u8g(10, 9, 8 );
U8GLIB_ST7920_128X64_1X   u8g2(13, 12, 11 );
Will this work?

477  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: December 27, 2013, 02:25:01 am

All fonts in u8glib are derived from the ".bdf" file format. It is a standard format to store bitmap fonts. Details are here: It is a plain text format, so you could also use a simple text editor to modify the bitmaps. There are also several font editors which allow export to bdf. Just to name two of them:

I have not used Fony for a while, but if i understand the latest ChangeLog corretly, it should be easy to copy and past your existing icons into a new font. Once this is done, export the font as bdf and convert it into a U8glib font with "bdf2u8g" (available for Windows on the U8glib download page on google code).

Have a look here on details how to use bdf2u8g:

As an example, here is how to extract the numbers only from helvB08:
1. Download
2. Use
bdf2u8g  -b 48 -e 57  ../bdf/helvB08.bdf u8g_font_helvB08n u8g_font_helvb08n.c
to extract the font with the bitmaps for chars "0"..."9". The result will look like this:
const u8g_fntpgm_uint8_t u8g_font_helvB08n[157] U8G_FONT_SECTION("u8g_font_helvB08n") = {
3. Copy this code into your .ino file and use "u8g_font_helvB08n" as argument for the "setFont" command.


478  Using Arduino / Displays / Re: teensy 3.0 with teensyduino and u8glib on: December 26, 2013, 04:36:28 pm
ok, i think the problem is, that you can not use the "Arduino" variant of U8glib, because Teensy 3.0 is an arm controller.
Use ""
Provide your own communication callback procedures for Teensy 3.0. See this page as an example:


479  Using Arduino / Displays / Re: teensy 3.0 with teensyduino and u8glib on: December 26, 2013, 07:45:44 am
As far as i remember, version v1.14 of u8glib includes all fixes known to me. Which version do you use? v1.14?
What are the exact errors you get?

480  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: December 24, 2013, 03:10:45 pm
Indeed a nice display for a good price. U8glib supports some true color displays, but mainly the reason for this support had been that other people started to create such devices. However, U8glib has been optimized for monochrom displays with SPI interface. TFT LCDs could be supported, but speed (especially for such a large 800x480 display) will be very poor. Maybe UTFT has support for it.

Merry Christmas to everybody,

Pages: 1 ... 30 31 [32] 33 34 ... 102