Go Down

Topic: ucglib (Read 61 times) previous topic - next topic

adriaan1

Hallo deelnemers forum;
Elke keer als ik een programma van ucglib wil gebruiken krijg ik ergens de mededeling ucg.( of iets anders) was not declared in this scope.
In onderstaand programma is dat de laatste regel waar de compiler blijft steken.
Is er iemand die mij kan vertellen waar ik iets aanpassen of veranderen moet?
Ps prog is te groot om in zijn geheel bij te voegen
Gr. Adriaan





ucg.setColor(255, 255, 255);
ucg.setPrintPos(2,18);
ucg.setPrintDir(0);
ucg.print("ClipRange");

ucg.setColor(0xd1, 0x00, 0x073);

ucg.setFont(ucg_font_helvB18_hr);

ucg.setPrintPos(25,45);
ucg.setPrintDir(0);
ucg.print("Ucg");
ucg.setPrintDir(1);
ucg.print("Ucg");
ucg.setPrintDir(2);
ucg.print("Ucg");
ucg.setPrintDir(3);
ucg.print("Ucg");


ucg.setMaxClipRange();
ucg.setColor(0xff, 0xff, 0xff);
ucg.drawFrame(20-1,30-1,15+2,20+2);  
ucg.setClipRange(20, 30, 15, 20);
ucg.setColor(0xff, 0x61, 0x0b8);
ucg.setPrintPos(25,45);
ucg.setPrintDir(0);
ucg.print("Ucg");
ucg.setPrintDir(1);
ucg.print("Ucg");
ucg.setPrintDir(2);
ucg.print("Ucg");
ucg.setPrintDir(3);
ucg.print("Ucg");


ucg.setMaxClipRange();
ucg.setColor(0xff, 0xff, 0xff);
ucg.drawFrame(60-1,35-1,25+2,18+2);  
ucg.setClipRange(60, 35, 25, 18);
ucg.setColor(0xff, 0x61, 0x0b8);
ucg.setPrintPos(25,45);
ucg.setPrintDir(0);
ucg.print("Ucg");
ucg.setPrintDir(1);
ucg.print("Ucg");
ucg.setPrintDir(2);
ucg.print("Ucg");
ucg.setPrintDir(3);
ucg.print("Ucg");

ucg.setMaxClipRange();
ucg.setColor(0xff, 0xff, 0xff);
ucg.drawFrame(7-1,58-1,90+2,4+2);  
ucg.setClipRange(7, 58, 90, 4);
ucg.setColor(0xff, 0x61, 0x0b8);
ucg.setPrintPos(25,45);
ucg.setPrintDir(0);
ucg.print("Ucg");
ucg.setPrintDir(1);
ucg.print("Ucg");
ucg.setPrintDir(2);
ucg.print("Ucg");
ucg.setPrintDir(3);
ucg.print("Ucg");

ucg.setFont(ucg_font_ncenR14_hr);
ucg.setMaxClipRange();
DLY();

}

void setup(void)
{
delay(1000);
ucg.begin(UCG_FONT_MODE_TRANSPARENT);
ucg.setFont(ucg_font_ncenR14_hr);
ucg.clearScreen();
}

void set_clip_range(void)
{
ucg_int_t x, y, w, h;
w = lcg_rnd() & 31;
h = lcg_rnd() & 31;
w += 25;
h += 25;
x = (lcg_rnd()*(ucg.getWidth()-w))>>8;
y = (lcg_rnd()*(ucg.getHeight()-h))>>8;

ucg.setClipRange(x, y, w, h);
}


uint8_t r = 0;
void loop(void)
{
switch(r&3)
{
  case 0: ucg.undoRotate(); break;
  case 1: ucg.setRotate90(); break;
  case 2: ucg.setRotate180(); break;
  default: ucg.setRotate270(); break;
}

if ( r > 3 )
{
  ucg.clearScreen();
  set_clip_range();
}

r++;
ucglib_graphics_test();
cross();
pixel_and_lines();
color_test();
triangle();
fonts();  
text();
if ( r <= 3 )
  clip();
box();
gradient();
//ucg.clearScreen();
DLY();
ucg.setMaxClipRange(); //Hier blijft compiler hangen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}

GijKieken

Heb je de bibliotheek wel ge-include?

Go Up