Show Posts
Pages: 1 ... 50 51 [52] 53 54 ... 82
766  Using Arduino / Displays / Re: Variable width font on a nokia 3310 LCD on: October 04, 2012, 03:06:59 pm
For sure this is possible, but there is no predefined algorithm to do this.

If I understand you correctly, then you want to solve the following problem.
Assume there is a long sentence:
"This is a very long text."
With a given font, only the substring
"This is a very long t"
fits to your screen.
Then you would like to break the string at the last blank and
put the missing part on the next line:
"This is a very long"
"text."

The only thing U8glib supports you, is to return the pixel width for a string with a specified font.
u8g.getStrWidth("This is a very long text.") might return a value, which is larger than your screen width
u8g.getStrWidth("This is a very long") might return a value, which is smaller than your screen width and
you will know that this fits to your screen (if you start drawing at the beginning of the screen).

So i think, "yes" it is possible and you will get all necessary information from u8glib.

Oliver
767  Using Arduino / Displays / Re: Variable width font on a nokia 3310 LCD on: October 04, 2012, 02:12:27 pm
You mean, fonts like these?  http://code.google.com/p/u8glib/wiki/fontsize
Most of them have variable character width.

And: U8glib supports PCD8544  smiley-wink

Oliver


768  Using Arduino / Displays / Re: Mega 2560 with ST7920 LCD and u8glib problem on: October 04, 2012, 02:06:00 pm
Hi

U8glib sends an init sequence to the display immediatly after reset. This init sequence might be corrupt or is not recognized by the display.

Some possible problems:
1) Your arduino is too fast, the display is not yet ready to receive the init sequence:
2) The reset of the display takes too long, the init sequence has been sent, but was not received.
3) Wires are unstable (connect problems) or are too long.
4) Timing of the data transfer is too fast for your display
5) Mode selection (parallel vs. serial) has a problem (or is missing or floating...)

I would start with the hardware: Check wires and their connection. Did you correctly set the mode for your display?

You might also provide more information: What is the mode? Parallel, seriel? Can you provide a picture?

Oliver
769  Using Arduino / Displays / Re: U8Glib and analog inputs. on: October 03, 2012, 11:41:00 pm
Hi

The main problem is, that the picture loop is always executed. It is better to redraw the display only in those cases where the content of the screen has changed. My suggestion is to introduce a flag "is_update_required" and execute the picture loop depending on this flag:

Code:
void loop(void) {
    getInputs();
    menuSelection();    // this procedure should set "is_update_required"
 
    if ( is_update_required )
    {
        // picture loop
        u8g.firstPage();
        do {
          draw();
        }
        // Serial.println("drawing");
        while( u8g.nextPage() );
        is_update_required = 0; // reset the update flag to avoid another redraw
    }
}

Once your program has detected a valid menu change, then the "is_update_required" must be set.
See also this tutorial for U8glib: http://code.google.com/p/u8glib/wiki/tmenu

One more note: The "Menu" addon M2tklib for U8glib also includes this mechanism.

Oliver
770  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: October 02, 2012, 03:02:50 pm
Hi Bill

The drawBitmap procedure expects a byte array, which is printed from left to right, MSB on the left. The drawXBM also expects a fixed format, but i can't remember the bit orientation.

The fact that each display might have a different byte orientations forces U8glib to perform a bitmap translation step from the high level command to the native display byte orientation. Indeed this is one of the most time consuming steps in U8glib. Unfortunately i do not know how to avoid this. There is not common memory layout for the displays. Each chip has an individual memory setup. Everytime I add a new chip, I am surprised to see another new memory layout  smiley-roll
 
Because i anyway had to add such a bitmap translation, it was not a big task to add the 90 degree rotation for the display orientation. Indeed this is something what i got almost for free (with respect to computation time): I just had to exchange the bitmap translation procedures, when such a different display orientation is requested.

For one of the newly added OLEDs I had to implement a completly new memory layout:
- I noticed that the new memory layout reduces speed (of course only for this display)
- So i decided to work on an overall speed optimization.
- All of the u8glib code was ported to my desktop so that i can apply "gprof" to it.
- I did a lot of gprof tests with the code to identify those procedures where most of the computation time is lost
- This all lead to several improvements, including one, where i had to restructure parts of the high level/low
level communication.
- Depending on the high level comands, speed is now improved by up to 30%, but still, GLCD is much faster.
- After spending many many hours on speed and performance analysis this summer, i know that there is not much room for further improvements.

U8glib offers flexibility and trades this for speed.

The good news is, that u8glib still is faster than many existing libraries (except GLCD).   smiley-wink

Oliver
771  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: October 02, 2012, 12:48:31 pm
Hi

I have released version 1.08 of u8glib. The new release has been optimized for speed and includes support for some more OLED chips. See details here: http://code.google.com/p/u8glib/.

This release also has a new COM interface for I2C/TWI based displays. The first supported I2C display is the Seeedstudio 96x96 OLED.

Thanks to all testers of the beta releases!

Oliver



772  Using Arduino / Displays / Re: Help needed with cheap OLED on: September 26, 2012, 12:17:37 pm
Then, also http://code.google.com/p/u8glib/ should work (4-Wire SPI).

Oliver
773  Using Arduino / Programming Questions / Re: Looking for tutorial on how to make a menu for my arduino, and then use buttons on: September 24, 2012, 03:49:33 pm
There are not only tutorials and youtube videos (thanks Nick), but also a lot of libs:

Library Name:             LCDMenu2
Download:             http://arduino.cc/forum/index.php/topic,73816.0.html

Library Name:             LCDMenu
Download:             http://arduino.cc/forum/index.php/topic,96104.0.html

Library Name:             MenuBackend
Download:             http://wiring.uniandes.edu.co/source/trunk/wiring/firmware/libraries/MenuBackend/

Library Name:             LCDMenu
Download:             http://www.metalgecko.com/arduino/LCDMenu.zip (does not exist any more)

Library Name:             Arduino_LCD_Menu
Download:             https://github.com/DavidAndrews/Arduino_LCD_Menu

Library Name:             MENWIZ
Download:             https://github.com/brunialti/MENWIZ

Library Name:             phi_prompt
Download:             http://liudr.wordpress.com/libraries/phi_prompt/

Library Name:             MenuSample
Download:             http://sourceforge.net/projects/arduinowifly/files/MenuSample/

Library Name:             M2tklib
Download:             http://code.google.com/p/m2tklib/


M2tklib has a lot of tutorials too....  smiley-wink

And finally i once made a tutorial for u8glib, which demonstrates building a menu with plain graphics primitives:
http://code.google.com/p/u8glib/wiki/tmenu

Oliver
774  Using Arduino / Programming Questions / Re: How does one implement the "text to Left " on a st7920 library on: September 24, 2012, 03:39:23 pm
You mean, "good story" but without use?

You mention a st7920 lib, but which one? It is difficult to give a precise answer with understanding all the background. Sometimes code helps to understand the problem.

Oliver

 
775  Using Arduino / Programming Questions / Re: How does one implement the "text to Left " on a st7920 library on: September 24, 2012, 02:24:08 pm
part one:

The artist went to the shop and asked for a pencil. He went home and made the most beautiful pictures ever.
The man went to the shop and asked for a pencil. At home he was not able to draw something and went back to ask the shop owner on better instructions on the pencil.

part two:

I am writing u8glib. It supports st7920. I provide a tool. I can give you details. And yes, i always wonder what amazing things are done with u8glib. Maybe i could be the teacher for technical details. But my users are the artists. I can not teach them to be artists.

part three:

Scrolling text is nothing else than showing a movie. Build you picture, draw text at (x,y). After some delay, draw your text at (x-1,y), than at (x-2,y), and so on. It will be visible as scrolling. U8glib will be tolerant for negative values, so drawing at (-3,10) will make characters appear half (good for scrolling :-)
 
Have fun,
Oliver

776  Using Arduino / Displays / Re: ELI5 - Setting up and running MOP-GL12232B-BGFW on: September 23, 2012, 02:50:31 pm
Hi

As far as I know, SBN1661 is compatible to the SED1520. For the SBN1661 you can use the two CS lines to latch data into the controller. RW can be fixed (to GND i think), but you need to set RS (also named DI or A0) to 0 or 1, depending if you want to send data or instructions. Both (cmds and data) are required for proper programming of the device.

I had once added support to u8glib (http://code.google.com/p/u8glib/wiki/device) for the SBN1661, so it should also work for SED1520. U8glib low level access is here: http://code.google.com/p/u8glib/source/browse/csrc/u8g_com_arduino_no_en_parallel.c

Oliver
777  Using Arduino / Displays / Re: can anybody identify this LCD panel connector???? on: September 23, 2012, 11:13:55 am
Ah, then, i would suggest to contact this company.

Oliver
778  Using Arduino / Displays / Re: can anybody identify this LCD panel connector???? on: September 22, 2012, 01:08:01 pm
Google does not know VOXCON. We do not see a picture of the display. How can we help. Please tell ASAP

Oliver
779  International / Deutsch / Re: Wie zeitliche Abläufe ohne delay() einfach gestalten? on: September 22, 2012, 01:01:11 pm
Am besten vergegenwärtigt man sich das Verhalten des Controllers mit einem Endlichen Zustandsautomaten (http://de.wikipedia.org/wiki/Endlicher_Automat).  Bedingungen für Zustandswechsel sind dann nicht nur externe Ereignisse, sondern könnten dann auch abgelaufene Zeitperioden sein. Beispiel: Ausgangszustand sei A. Nach 5 Sekunden soll Zustand B eingenommen werden: Bei betreten von Zustand A berechnet man die neue Zielzeit aus der aktuellen Zeit plus 5 Sekunden. Wenn die Zielzeit erreicht ist, wird der Zustand auf B gewechselt.

Grüße,
Oliver
780  International / Deutsch / Re: Linux (Ubuntu ) und Arduino - IDE bzw welcher Editor hat Makrofunktionen on: September 22, 2012, 04:31:14 am
Hi

Unter Linux und Windows nehme ich den scite (http://www.scintilla.org/SciTE.html).
Soweit ich gesehen habe kann man damit externe Befehle absetzen, habe das aber
noch nicht ausprobiert.

Die Arduino IDE benutze ich nicht mehr, sondern nur noch Makefiles.
Beispielsweise hier: http://arduino.cc/forum/index.php/topic,88989.0.html


Grüße,
Oliver
Pages: 1 ... 50 51 [52] 53 54 ... 82