Closed larryl79 closed 2 years ago
Solution !!!!
extern char* g_LCDML_DISP_lang_lcdml_table[254];
into a right place in the example code:
`// ============================================================ // Example: LCDML_serialmonitor // ============================================================
[...]
//#define _LCDML_cfg_use_ram
// // includes //
extern char* g_LCDML_DISP_lang_lcdml_table[254];
// U8g2lib
// #include
// // U8GLIB // // U8g2 Constructor List (Frame Buffer) // The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, / CS=/ 53, / reset=/ U8X8_PIN_NONE); // (MEGA, ... //U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, / CS=/ 12, / reset=/ U8X8_PIN_NONE); // (Uno and co U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, / clock=/ 25, / data= /R/w / 33, / CS=/ 32, / reset= / U8X8_PIN_NONE ); // ESP32
// settings for u8g lib and LCD
// font settings
// cursor settings
// menu position and size
// scrollbar width
// nothing change here
// rows and cols // when you use more rows or cols as allowed change in LCDMenuLib.h the define "_LCDML_DISP_cfg_max_rows" and "_LCDML_DISP_cfg_max_string_length" // the program needs more ram with this changes
// // Prototypes // void lcdml_menu_display(); void lcdml_menu_clear(); void lcdml_menu_control();
// // Objects // LCDMenuLib2_menu LCDML_0 (255, 0, 0, NULL, NULL); // root menu element (do not change) LCDMenuLib2 LCDML(LCDML_0, _LCDML_DISP_rows, _LCDML_DISP_cols, lcdml_menu_display, lcdml_menu_clear, lcdml_menu_control);
// // LCDML MENU/DISP // // LCDML_0 => layer 0 // LCDML_0_X => layer 1 // LCDML_0_X_X => layer 2 // LCDML_0_X_X_X => layer 3 // LCDML0... => layer ...
// For beginners // LCDML_add(id, prev_layer, new_num, lang_char_array, callback_function)
[...] `
example code #vscode #platformio #esp32 devkit
I've edited your LCDML_001_liquidCrystal.ino example for platformio (renamed to main.cpp, and included rest of the files as .h after constructor).
src dir:
LCDML_condition.h LCDML_control.h LCDML_display_dynFunction.h LCDML_display_menu.h LCDML_display_menuFunction.h main.cpp
main.cpp (edited part): `// // Objects // LCDMenuLib2_menu LCDML_0 (255, 0, 0, NULL, NULL); // root menu element (do not change) LCDMenuLib2 LCDML(LCDML_0, _LCDML_DISP_rows-_LCDML_DSIP_use_header, _LCDML_DISP_cols, lcdml_menu_display, lcdml_menu_clear, lcdml_menu_control);
include
include
include
include
include
// // LCDML MENU/DISP // `
(for another try I downloaded the latest lib from github, and overwritten in the libs dir. It's same issue) when I try compile, I got error messages for the lib itself only.
In file included from C:\Users\larry\.platformio\lib\LCDMenuLib2\src/LCDMenuLib2.h:183:0, from src\main.cpp:24: src/LCDML_display_menu.h: In function 'void lcdml_menu_display()': C:\Users\larry\.platformio\lib\LCDMenuLib2\src/LCDMenuLib2_macros.h:118:29: error: 'g_LCDML_DISP_lang_lcdml_table' was not declared in this scope strcpy(var, g_LCDML_DISP_lang_ ## lang ## _table[id]); \ ^ C:\Users\larry\.platformio\lib\LCDMenuLib2\src/LCDMenuLib2_macros.h:138:9: note: in expansion of macro 'LCDML_getCustomContent' LCDML_getCustomContent(lcdml, var, id) ^ src/LCDML_display_menu.h:50:9: note: in expansion of macro 'LCDML_getContent' LCDML_getContent(content_text, LCDML.MENU_getParentID()); ^ C:\Users\larry\.platformio\lib\LCDMenuLib2\src/LCDMenuLib2_macros.h:118:29: error: 'g_LCDML_DISP_lang_lcdml_table' was not declared in this scope strcpy(var, g_LCDML_DISP_lang_ ## lang ## _table[id]); \ ^ C:\Users\larry\.platformio\lib\LCDMenuLib2\src/LCDMenuLib2_macros.h:138:9: note: in expansion of macro 'LCDML_getCustomContent' LCDML_getCustomContent(lcdml, var, id) ^ src/LCDML_display_menu.h:69:13: note: in expansion of macro 'LCDML_getContent' LCDML_getContent(content_text, tmp->getID()); ^ *** [.pio\build\esp32doit-devkit-v1\src\main.cpp.o] Error 1