Show Posts
Pages: 1 ... 40 41 [42] 43 44 ... 102
616  Using Arduino / Displays / Re: intro screen in m2tk lib with glcd on: August 01, 2013, 03:37:31 am
Here is at least one workaround, which at least compiles (not checked on the target):

Update "Arial_bold_14.h"

Instead of
Code:
static uint8_t Arial_bold_14[] PROGMEM = {
use
Code:
static uint8_t Arial_bold_14[] __attribute__ ((section (".progmem.arial_bold_14"))) = {

Oliver

617  Using Arduino / Displays / Re: intro screen in m2tk lib with glcd on: August 01, 2013, 03:18:56 am
ok, thanks, i can reproduce the problem.

Oliver
618  Using Arduino / Displays / Re: intro screen in m2tk lib with glcd on: August 01, 2013, 02:25:04 am
Hi hydrogen99

I try to reproduce the problem on my PC, but Image1.h is missing. Can you attach this file also.
What is your exact version of the Arduino IDE?

@Bill: E-Mail sent.

Oliver
619  Using Arduino / Displays / Re: intro screen in m2tk lib with glcd on: July 31, 2013, 04:52:56 pm
Hi

There is a tutorial which gives some introduction on how to combine graphics and M2tklib: http://code.google.com/p/m2tklib/wiki/t06glcd

The actual error in your code is more difficult. At the moment i can not do more than give you some ideas and keywords.
- As far as I know fonts are defined (not declared) in the .h files, which might lead to some problems, when included twice
- Font definition make use of the PROGMEM attribute.
- GNU C++ is has at least one bug with the PROGMEM sections.
- GNU C++ has changed its behaviour with respect to PROGMEM area. The error might depend on the IDE version and the question whether you have installed a parallel gnu compiler suite.

Ideas for a solution:
- Using C-Code instead of C++ code sometimes helps
- Maybe an additional C++ file for the intro screen might also help
- You might consider to use U8glib instead of GLCD (if this is a KS0108 display with 128x64 pixel size). Fonts in U8glib are declared in a different way so that the above mentioned problem "usually" will not appear.

Some more discussion happend here:
http://forum.arduino.cc/index.php/topic,77405.0.html
But i think there was also no result...

Oliver
620  International / Deutsch / Re: Großes Display gesucht on: July 31, 2013, 03:20:27 pm
das Display von olikraus sieht schon mal genial aus und die lib auch. Was ist das für ein Display.
Auf dem Bild handelt sich um ein Varitronix Display mit 240x128 Pixel. Man könnte sagen ein Standard T6963 Display, allerdings one DC/DC converter (weswegen ich die -15V mit meinem Labornetzteil erzeugen musste).


Ich habe drei interessante Displays gefunden, aber befürchte keines läuft mit der genannten lib.
TFT Module werden von U8glib nicht unterstützt (bis auf ein paar Experimente von mir). U8glib ist traditionell eher eine Lib für monochrom Displays.

Wenn ich mal konkret etwas empfehlen darf: Die Restposten von NHD sind oft ganz interessant (obwohl die Versandkosten recht hoch sind). Unter anderem wird dieses Display angeboten, das von U8glib unterstützt werden sollte (RA6963 = T6963 Chipsatz) :
http://www.newhavendisplay.com/nhd240128wgbfghvzc-p-571.html
$20 sind an sich schon ein super Preis für so ein Display. Selbst gebraucht kosten die oft das doppelte.
Die "nicht-reduzierten" monochromen NHD LC-Displays und OLEDs, bekommt man übrigens bei www.mouser.com. Ab 70€ ohne Versandkosten und bis 150€ zollfrei (wie im letzten Beitrag erwähnt) nach Deutschland.

Ein gutes großes monochromes Display wäre dann noch das EA DOGXL160:
http://www.reichelt.de/DOG-LCD-Module/EA-DOGXL160W-7/3//index.html?ACTION=3&GROUPID=3007&ARTICLE=101660&SHOW=1&START=0&OFFSET=500&
Der große Vorteil vom DOGXL160 ist das SPI Interface, das voll von U8glib unterstützt wird.

Hier wollte ich mal bestellen, hab's aber noch nicht, deshalb kann ich auch nichts zu dem Laden sagen. Aber schön große monochrome Displays sind es schon:
http://www.buy-display.com/default/graphic-lcd-display-module-1/240x128-graphic-lcd-display-module.html?cotroller_ic=448

Grüße,
Oliver




621  Using Arduino / Displays / Re: LCD to show Keypad input, not displaying on: July 31, 2013, 02:38:37 pm
Even more simpler could be this:
Code:
#include <Keypad.h>
#include "U8glib.h"

U8GLIB_ST7920_128X64 u8g(13, 11, 12, U8G_PIN_NONE);

const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  {'1','2','3','<'},
  {'4','5','6','>'},
  {'7','8','9','='},
  {'*','0','I','U'}
};
byte rowPins[ROWS] = {2,3,4,5}; //connect to row pinouts
byte colPins[COLS] = {6,7,8,9}; //connect to column pinouts

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

char key;  // key should be a global variable, written in "loop()" and read in "draw()"

void draw(void) {
  u8g.setFont(u8g_font_osb18);
  u8g.setPrintPos(0, 18);
  u8g.print(key);
}

void setup(){
  Serial.begin(9600);
}
void loop(){
  key = keypad.getKey();
  if (key != NO_KEY){
    Serial.println(key);
    u8g.firstPage();
    do {
      draw();
    } while( u8g.nextPage() );
 }
}

Oliver
622  Using Arduino / Displays / Re: LCD to show Keypad input, not displaying on: July 31, 2013, 04:17:18 am
The reason for the malfunction could be cause of using the getKey function inside the "picture loop". This was also discussed recently here: http://forum.arduino.cc/index.php?topic=179389.0

Maybe this modified code works:
Code:
#include <Keypad.h>
#include "U8glib.h"

U8GLIB_ST7920_128X64 u8g(13, 11, 12, U8G_PIN_NONE);

const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  {'1','2','3','<'},
  {'4','5','6','>'},
  {'7','8','9','='},
  {'*','0','I','U'}
};
byte rowPins[ROWS] = {2,3,4,5}; //connect to row pinouts
byte colPins[COLS] = {6,7,8,9}; //connect to column pinouts

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

char key;  // key should be a global variable, written in "loop()" and read in "draw()"

void draw(void) {

  u8g.setFont(u8g_font_osb18);
  u8g.setPrintPos(0, 18);
  u8g.print(key);


}

void setup(){
  Serial.begin(9600);
}

void loop(){
  char tmp_key;
  tmp_key = keypad.getKey();
  if ( tmp_key != NO_KEY )
    key = tmp_key;
  u8g.firstPage();
  do {
    draw();
  } while( u8g.nextPage() );
  delay(500);
  if (tmp_key != NO_KEY){
    Serial.println(tmp_key);
 }
}

Oliver
623  Using Arduino / Displays / Re: perplexed with U8glib :) on: July 31, 2013, 12:35:51 am
Curious, why not remove the comments, before it is downloaded?

Thanks, Jack

Because I do not know which display in which configuration is used. Examples look like this and you hve to uncomment one line:
Code:
// setup u8g object, please remove comment from one of the following constructor calls
// IMPORTANT NOTE: The following list is incomplete. The complete list of supported
// devices with all constructor calls is here: http://code.google.com/p/u8glib/wiki/device
//U8GLIB_NHD27OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD27OLED_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD27OLED_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD27OLED_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGS102 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGM132 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGM128 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGM128_2X u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_ST7920_128X64_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_128X64_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_128X64_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_128X64_4X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_192X32_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_192X32_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_4X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_1X u8g(13, 11, 10); // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10
//U8GLIB_ST7920_192X32_4X u8g(10); // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10, HW SPI
//U8GLIB_ST7920_202X32_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_202X32_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_202X32_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_202X32_4X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_LM6059 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_LM6063 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGXL160_BW u8g(10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGXL160_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGXL160_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGXL160_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_PCD8544 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8
//U8GLIB_PCF8812 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8
//U8GLIB_KS0108_128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs1=14, cs2=15,di=17,rw=16
//U8GLIB_LC7981_160X80 u8g(8, 9, 10, 11, 4, 5, 6, 7,  18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs=14 ,di=15,rw=17, reset = 16
//U8GLIB_LC7981_240X64 u8g(8, 9, 10, 11, 4, 5, 6, 7,  18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs=14 ,di=15,rw=17, reset = 16
//U8GLIB_LC7981_240X128 u8g(8, 9, 10, 11, 4, 5, 6, 7,  18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs=14 ,di=15,rw=17, reset = 16
//U8GLIB_ILI9325D_320x240 u8g(18,17,19,U8G_PIN_NONE,16 );  // 8Bit Com: D0..D7: 0,1,2,3,4,5,6,7 en=wr=18, cs=17, rs=19, rd=U8G_PIN_NONE, reset = 16
//U8GLIB_SBN1661_122X32 u8g(8,9,10,11,4,5,6,7,14,15, 17, U8G_PIN_NONE, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 cs1=14, cs2=15,di=17,rw=16,reset = 16
//U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SSD1306_128X64 u8g(10, 9); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1306_128X32 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SSD1306_128X32 u8g(10, 9);             // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1306_128X32 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1309_128X64 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SSD1327_96X96_GR u8g(U8G_I2C_OPT_NONE); // I2C
//U8GLIB_SSD1327_96X96_2X_GR u8g(U8G_I2C_OPT_NONE); // I2C
//U8GLIB_NHD_C12864 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, RST = 8
//U8GLIB_NHD_C12832 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, RST = 8
//U8GLIB_T6963_240X128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 14, 15, 17, 18, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7, cs=14, a0=15, wr=17, rd=18, reset=16
//U8GLIB_T6963_240X64 u8g(8, 9, 10, 11, 4, 5, 6, 7, 14, 15, 17, 18, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7, cs=14, a0=15, wr=17, rd=18, reset=16
//U8GLIB_T6963_128X64 u8g(8, 9, 10, 11, 4, 5, 6, 7, 14, 15, 17, 18, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7, cs=14, a0=15, wr=17, rd=18, reset=16
//U8GLIB_HT1632_24X16 u8g(3, 2, 4); // WR = 3, DATA = 2, CS = 4
//U8GLIB_SSD1351_128X128_332 u8g(13, 11, 8, 9, 7); // Arduino UNO: SW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_332 u8g(76, 75, 8, 9, 7); // Arduino DUE: SW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_332 u8g(8, 9, 7); // Arduino: HW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_4X_332 u8g(76, 75, 8, 9, 7); // Arduino DUE: SW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_4X_332 u8g(8, 9, 7); // Arduino : HW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_HICOLOR u8g(76, 75, 8, 9, 7); // Arduino DUE, SW SPI Com: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_HICOLOR u8g(8, 9, 7); // Arduino, HW SPI Com: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_4X_HICOLOR u8g(76, 75, 8, 9, 7); // Arduino DUE, HW SPI Com, 4x Memory: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)
//U8GLIB_SSD1351_128X128_4X_HICOLOR u8g(8, 9, 7); // Arduino, HW SPI Com, 4x Memory: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx)

Oliver
624  International / Deutsch / Re: Großes Display gesucht on: July 30, 2013, 04:21:45 pm
Scharf sind die Displays schon, aber die Schrift kommt manchmal etwas "pixelig" rüber. Aber ein 4 Zoll display mit 200 dpi läßt sich halt dann doch nicht mehr am Arduino Uno betrieben.

Oliver
625  International / Deutsch / Re: Großes Display gesucht on: July 30, 2013, 03:14:32 pm
Hallo Zusammen

Ich wollte noch auf U8glib hinweisen (http://code.google.com/p/u8glib/):
- Betrieb eines T6963 Displays mit 240x128 auch am Arduino Uno
- Pixel-genaues Positionieren von Buchstaben
- Sparsamer Umgang mit RAM
- Unterstützt sehr viele monochrome Graphic Displays, die es gebraucht oder neu zu kaufen gibt.
- Unterstützt SPI und 8-Bit Interfaces (manchmal auch I2C)

Ich habe irgendwann aufgehört zu zählen, wie viele Fonts ich für U8glib gesammelt hatte. Alle großen und kleinen Fonts sind hier aufgelistet: http://code.google.com/p/u8glib/wiki/fontsize. Alle dort gezeigten Fonts sind Bestandteil der Library.

Als Anregung noch ein kleines Bild aus meinem Hobbykeller:


Das Display stammt aus der Bucht, die Graphik oben links ist keine Bitmap, sondern besteht aus 2 Fonts (wobei die 8 um 90 Grad gedreht ist) und zwei Linien. Code sieht so aus:
Code:
void drawLogo(uint8_t d)
{
  u8g.setFont(u8g_font_gdr25r);
  u8g.drawStr(0+d, 30+d, "U");
  u8g.setFont(u8g_font_gdr30n);
  u8g.drawStr90(23+d,10+d,"8");
  u8g.setFont(u8g_font_gdr25r);
  u8g.drawStr(53+d,30+d,"g");
 
  u8g.drawHLine(2+d, 35+d, 47);
  u8g.drawVLine(45+d, 32+d, 12);
}

Übrigens wäre vielleicht auch ein OLED wie dieses hier ganz interessant:
http://www.newhavendisplay.com/nhd2712864ucy3-p-3621.html
OLEDs haben gegenüber LCDs einen weitaus besseren Kontrast.


Grüße,
Oliver
626  Using Arduino / Displays / Re: perplexed with U8glib :) on: July 30, 2013, 02:40:58 pm
Code:
/*

  HelloWorld.pde
 
  "Hello World!" example code.
 
  >>> Before compiling: Please remove comment from the constructor of the
  >>> connected graphics display (see below).
 
  Universal 8bit Graphics Library, http://code.google.com/p/u8glib/

If anybody finds a better wording than
Code:
  >>> Before compiling: Please remove comment from the constructor of the
  >>> connected graphics display (see below).
please let me know.

I probably should also put a red blinking alert light next to these two lines  smiley-wink


Oliver
627  Using Arduino / Programming Questions / Re: Menu for Display on: July 30, 2013, 02:35:38 pm
Hi

getKey() will remove the event from the queue. So any other call to getKey() will return NONE or another key. You must only call getKey() once, store the result and then check for the key:
Code:
uint8_t key = m2.getKey();
if ( key != M2_KEY_NONE )
    {
    if (key == M2_KEY_HOME2)  --> new shortcut
     {
          digitalWrite(13, LOW);
          m2.setRoot(&el_num_menu);   // refer to a suitable menu
     }
          digitalWrite(13, LOW);
          m2.setRoot(&top_el_expandable_menu);   // refer to a suitable menu
     }

See the also http://code.google.com/p/m2tklib/wiki/fnref#getKey

Still amazing thread. I think you must have been used all the features of m2tklib until now...  smiley-eek

Oliver
628  Using Arduino / Displays / Re: testing u8glib and GLCD 12864 on: July 25, 2013, 04:30:23 pm
I need to see the code to give more specific suggestion, but here is some idea:

WRONG:
Code:
  int x = 0;
  for(;;) {
    u8g.firstPage(); 
    do {
      u8g.setFont(u8g_font_unifont);
      u8g.setPrintPos(0, 20);
      u8g.print(x);
      x++;                   // WRONG: x is changed within the picture loop
    } while( u8g.nextPage() );
  }

Correct:
Code:
  int x = 0;
  for(;;) {
    u8g.firstPage(); 
    do {
      u8g.setFont(u8g_font_unifont);
      u8g.setPrintPos(0, 20);
      u8g.print(x);   
    } while( u8g.nextPage() );
    x++;
  }

This is explained here http://code.google.com/p/u8glib/wiki/thelloworld and here http://code.google.com/p/u8glib/wiki/tpictureloop

Another example is the use of the ADC converter:
WRONG:
Code:
  for(;;) {
    u8g.firstPage(); 
    do {
      u8g.setFont(u8g_font_unifont);
      u8g.setPrintPos(0, 20);
      u8g.print(analogRead(3));             // Wrong: Output is different with each iteration of the loop
    } while( u8g.nextPage() );
  }


Correct:
Code:
  int x = 0;
  for(;;) {
    x = analogRead(3);
    u8g.firstPage(); 
    do {
      u8g.setFont(u8g_font_unifont);
      u8g.setPrintPos(0, 20);
      u8g.print(x);
    } while( u8g.nextPage() );
  }

A similar mistake has happend here: http://bobdavis321.blogspot.de/2013/06/universal-8-bit-graphics-library-bug.html. I asked Bob to fix this article (you will find a small UPDATE note there), because the this is not a bug in U8glib.

Oliver
629  Using Arduino / Programming Questions / Re: Menu for Display on: July 25, 2013, 03:07:30 pm
Thanks for reporting. There was a small bug, which is fixed in the attached release.

Oliver
630  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: July 21, 2013, 05:30:08 pm
Thanks. I have updated issue 190 to add your patch as part of the support for attiny.

Oliver
Pages: 1 ... 40 41 [42] 43 44 ... 102