Open SkHCrusher opened 7 years ago
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:
`// Vendor Libs
Adafruit_SH1106 display = Adafruit_SH1106(51, 52, 5, 4, 6);
Menu menu = Menu(display);
void setup() { display.begin(SH1106_SWITCHCAPVCC); display.display(); }
void loop() { }`
`#include
class Menu { public: Menu(); void Setup(Adafruit_SH1106& ssd1306); };`
`#include "Arduino.h"
Menu::Menu() { //display.clearDisplay(); //display.display(); }
void Menu::Setup(Adafruit_SH1106& ssd1306) { return; }`
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
include
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
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; }`