Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrblue-eth opened this issue Feb 18, 2024 · 0 comments
Open

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

mrblue-eth opened this issue Feb 18, 2024 · 0 comments

Comments

@mrblue-eth
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant