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
http://code.google.com/p/glcd-arduino/
or
https://bitbucket.org/bperrybap/openglcd/wiki/Home

Oliver
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.

Oliver
468  Using Arduino / Displays / Re: st7920 lcd12864 glcd on: January 01, 2014, 11:08:43 am
Quote
But i don't understan why i need to do this
This is a FAQ.I tried to explain this here: http://code.google.com/p/u8glib/wiki/tpictureloop

Quote
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:

Code:
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.

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

Is this the same display as mention here http://forum.arduino.cc/index.php?topic=203519.msg1501707#msg1501707?
Did you solve all problems? What had been the problems? How did you solve the FS1/FS2 issue?

Oliver
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":

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

See also http://code.google.com/p/u8glib/wiki/thelloworld

Oliver
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:
Code:
#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() {
  u8g.setFont(u8g_font_unifont);
}

void loop() {
  val = analogRead(analogPin);
  u8g.firstPage(); 
  do {
    u8g.setPrintPos(0,10);
    u8g.println(val);
  } 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:
http://code.google.com/p/u8glib/wiki/tpictureloop


Oliver
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.

Oliver
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.

Oliver
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
  cnt++;
  delay(1000)
  print "cnt" on second display
  cnt++;
  delay(1000)
}

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?

Oliver
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".

Quote
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...

Oliver
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?

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

All fonts in u8glib are derived from the ".bdf" file format. It is a standard format to store bitmap fonts. Details are here: http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format. 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:
Fony: http://hukka.ncn.fi/?fony
Fontforge: http://fontforge.org/

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: http://code.google.com/p/u8glib/wiki/bdf2u8g.

As an example, here is how to extract the numbers only from helvB08:
1. Download http://u8glib.googlecode.com/hg/tools/font/bdf/helvB08.bdf
2. Use
Code:
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:
Code:
const u8g_fntpgm_uint8_t u8g_font_helvB08n[157] U8G_FONT_SECTION("u8g_font_helvB08n") = {
  0,12,19,255,251,8,0,0,0,0,48,57,0,8,0,8,
  0,5,8,8,6,0,0,112,216,216,216,216,216,216,112,3,
  8,8,6,1,0,96,224,96,96,96,96,96,96,5,8,8,
  6,0,0,112,216,24,24,48,96,192,248,5,8,8,6,0,
  0,112,216,24,48,24,24,216,112,6,8,8,6,0,0,8,
  24,56,88,152,252,24,24,5,8,8,6,0,0,248,192,192,
  240,24,152,216,112,5,8,8,6,0,0,112,216,192,240,216,
  216,216,112,5,8,8,6,0,0,248,24,24,48,48,96,96,
  96,5,8,8,6,0,0,112,216,216,112,216,216,216,112,5,
  8,8,6,0,0,112,216,216,216,120,24,216,112};
3. Copy this code into your .ino file and use "u8g_font_helvB08n" as argument for the "setFont" command.

Oliver



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.
Instead:
Use "u8glib_arm_v1.14.zip"
Provide your own communication callback procedures for Teensy 3.0. See this page as an example:
http://blog.bastelhalde.de/?p=759

Oliver

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?

Oliver
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,

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