olikraus / U8g2_for_Adafruit_GFX

Add U8g2 fonts to any Adafruit GFX based graphics library.
Other
103 stars 32 forks source link

how can I use functions from the main u8g2 library? #46

Open mrblue-eth opened 5 months ago

mrblue-eth commented 5 months ago

I can't use any function from the main u8g2 library. how can I use them?

#include <Adafruit_GFX.h>    // Core graphics library
#include <MCUFRIEND_kbv.h>   // Hardware-specific library
#include <U8g2_for_Adafruit_GFX.h>
MCUFRIEND_kbv tft;
U8G2_FOR_ADAFRUIT_GFX u8g2;

void setup(){
  uint16_t ID = tft.readID();
  if (ID == 0xD3) ID = 0x9481;
  tft.begin(ID);
  tft.setRotation(1);
  tft.fillScreen(TFT_BLUE);

  u8g2.begin(tft);
  u8g2.setBackgroundColor(TFT_BLACK);
  u8g2.setForegroundColor(TFT_WHITE);
  u8g2.setCursor(0,0);

  u8g2.drawBox(0,0,25,15);
}

void loop(){
}

I get this error when verifying my code in Arduino IDE: 'class U8G2_FOR_ADAFRUIT_GFX' has no member named 'drawBox'