problem with UCGLIB

Hi,

I have a problem with the UCGLIB.h my arduino doesnt compile it.

here is the code:

##############################
#include <SPI.h>
#include "Ucglib.h"

Ucglib_ILI9341_18x240x320_HWSPI ucg(/cd=/ 26 , /cs=/ 24, /reset=/ 22); //at Mega and Due

void setup(void){
delay(1000);
ucg.begin(UCG_FONT_MODE_TRANSPARENT);

}

void loop(void){
//ucg.setRotate90();
ucg.setFontPosBaseline();
ucg.setFont(ucg_font_ncenB18);
ucg.setColor(255, 0, 255);
ucg.setPrintPos(45,30);
ucg.setPrintDir(0);
ucg.print("Ucg");
delay(10000);
ucg.clearScreen();
}

############################################

The Error is:

#################################################
Arduino: 1.6.7 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

E:\Arduino\Wetter\Wetter.ino: In function 'void loop()':

Wetter:16: error: 'ucg_font_ncenB18' was not declared in this scope

ucg.setFont(ucg_font_ncenB18);

^

exit status 1
'ucg_font_ncenB18' was not declared in this scope

##############################################

why doesnt he accept "ucg_font_ncenB18"?

Its in the Library reference!

I Think the problem is, that Arduino cant find the Font. Is ist Possible to install fonts?

Hi

The font is part of the ucglib distribution. The declaration is there in line 1037 of ucg.h:

Did you use the Arduino Library manager to install ucglib? Which version of ucglib do you use?

Oliver

I Use the Ucglib_Arduino-1.3.3

I used the library manager

If I want to install the Lib from your link it doesnt work with the manager. I have to copy it into the Folder.

It still doesnt work. it seems, that he cant find the file ucg.h

Hi

I am confused

I used the library manager

ok

If I want to install the Lib from your link it doesnt work with the manager

Which link? You do not need a link to install Ucglib from the library manager of the Arduino IDE.
You are saying it does NOT work with the library manager?

I have to copy it into the Folder.

Do not do this. Arduino IDE requires a lot of other files and a special structure.

I just tried everything again on my machine and everything works nicely.
However i just noticed, that i the fontname (your first post) is indeed wrong. It should be: ucg_font_ncenB18_tr
I had changed the naming convention for the latest release.

See here:

Oliver

Hi,
Is it possible to draw a circle in any portion other than just 4 options currently selectable?

I have tried using draw pixel with "for" and trigonometric function loop but it seems doesnt work in my sketch.

Is it possible to draw a circle in any portion other than just 4 options currently selectable?

No. Advantage is, that ucglib does not require trigonemtric math functions.

Oliver