wonho-maker/Adafruit_SH1106

How to use in subclass?

Opened this issue · 0 comments

Hi,

i want to build up a small menu lib for the OLED.
But i have problems to use your lib in the main .ino file and also in a subclass like a Menu.cpp/Menu.h.

i reduced the Code but it doesn't work and I hope you can help me:

test.ino

`// Vendor Libs
#include <Adafruit_GFX.h>
#include <Adafruit_SH1106.h>

Adafruit_SH1106 display = Adafruit_SH1106(51, 52, 5, 4, 6);

#include "Menu.h";
Menu menu = Menu(display);

void setup() {
display.begin(SH1106_SWITCHCAPVCC);
display.display();
}

void loop() {
}`

Menu.h

`#include <Arduino.h>

class Menu {
public:
Menu();
void Setup(Adafruit_SH1106& ssd1306);
};`

Menu.cpp

`#include "Arduino.h"
#include "Menu.h";

Menu::Menu()
{
//display.clearDisplay();
//display.display();
}

void Menu::Setup(Adafruit_SH1106& ssd1306) {
return;
}`