TcMenu / tcMenuLib

TcMenu modular IoT menu library supporting rotary encoder, joysticks, many displays, and remote control over Ethernet and Serial
Apache License 2.0
111 stars 10 forks source link

Code won't compile with u8g2 #218

Closed nmeurer closed 2 months ago

nmeurer commented 4 months ago

Hi there, after searching for quite some time, I still can't find the issue. My main strength also isn't in programming so any help would be very much appreciated.

Describe the bug A clear and concise description of what the bug is. I can't get the generated code working. I modified nothing and just made changes in the editor.

Confirm that the bug is in the embedded library I interpret the given error as a bug in the library, but I am by no means an expert.

To Reproduce Please include a simple sketch that recreates the problem unless the problem is so easily recreated that such a sketch is not needed. Create any menu using the u8g2 quickstart with these settings:

Screenshot 2024-06-21 004533

Expected behavior I expected the code to compile

Screenshots If applicable, add screenshots to help explain your problem. Compiler error message: Screenshot 2024-06-21 004732

Device Specs An arduino mega with a ST7920 128x64 attatched via hardware SPI

Additional context I also tried using the manual u8g2 setup, but I don't seem to get it right. I'd love to see an example of how it is supposed to be done.

Regards

vzahradnik commented 4 months ago

Hmm... It works for me. Check the contents of *_menu.h. It should contain a variable like this:

extern U8G2_SSD1309_128X64_NONAME0_F_HW_I2C gfx;

Then check *_menu.cpp whether you can see an initialization code.

U8G2_SSD1309_128X64_NONAME0_F_HW_I2C gfx(/*some parameters*/);

Third, make sure *_menu.h is included within *_menu.cpp.

davetcc commented 2 months ago

Hi we've had no update on this in several months, we'll close the issue for now. Should you still be having the same issue please reopen and provide the project zipped up.