Message |
|
Hello, I am using the widget function (like the wireless connection on some of the examples, esp8266 etc...)
The functionality works. But when I want to change the widget state inside of a function, it only changes once the function ends and effectively goes to another iteration of the loop.
What I want to do:
Is call an external function to do something (like wifimanager). This causes the menu to stop, until the function ends.
I want to change the widget in the title to reflect (like a save icon on video game save areas).
I want to set the icon at the beginning of the function, then change it again at the end of the function. But doing this doesn't do anything until the function ends which defeats the purpose.
is there any way to update the widgets outside of the main loop? I tried
taskManager.runLoop();
inside the external function but to no avail.
any help is appreciated
|
 |
|
Thank you, really appreciate it! The Icons are perfect now.
Will write what worked for me if anyone else finds this and wants to know how to generate char arrays
Used Gimp and opened my image.
-Resize image to Icons size (e.g. 16*16 pixels)
- Convert image to indexed Black and White (to save memory)
https://docs.gimp.org/2.10/en/gimp-image-convert-indexed.html
- Export as .xbm
- Open generated file with text editor (notepad), and find the char array for the image
|
 |
|
Thank you, I look forward to the updates.
I updated everything, and ran the esp32amplifier from the designer and generated the code matching my rig. And after copying the code for the icons for the links you provided, it worked now, thank you.
Now I am trying to make my own icons, but every convertor i try results in a wrong image. What did you use to make the icons?
|
 |
|
I just noticed that there is a version 2.2 Beta release. Could it be that I need that version instead of 2.1?
|
 |
|
Thank you,
I look forward to the tutorial, as so far I couldn't figure it out.
|
 |
|
Thank you,
I added the new line, but i still dont get an icon on screen. I may be missing something ot maybe I am not understanding the coordinate system and drawing it offscreen
|
 |
|
Thank you,
I looked at the example and documentation. From what I what I understood that I only add code to the void setup of the main .ino
I made a basic project and tried to implement the icons. It compiles, but no Icons on display. I tried once with a text item menu, and once with a submenu.
Should there be a refresh function that I may be missing?
|
 |
|
Yeah, I understand the limitation in the rendering libraries.
Still thank you, the library is one hell of a middle man.
for the icons, I only found the page on how to do it for title widgets. Not sure if the same method applies to regular menu items? Or at least a text menu item?
|
 |
|
If foreign characters are proving to be a hassle, is there a way to make the menu an image instead of text?
or symbols? Because I am thinking of drawing the arabic text and having the image appear as the menu.
Is this possible?
|
 |
|
Hi, sorry for the late reply.
I again tried to run different adafruit example and found that the fork was the problem (some code it runs, some it doesn't). Sorry for my mistake.
I have also tried another approach which was to use the U8g2_for_Adafruit_GFX library. And found that it does work.
Library: https://github.com/olikraus/u8g2
But my problem is that I dont know how to adapt the tcmenu to accomodate. I made a simple library and verified that arabic works by including code to write a string in the setup part (not through tcmenu functions). But I was not able (or not knowledgable enough) to make the tcmenu use it.
I have included a simple menu as an attachment.
|
 |
|
|
 |
|
|
 |
|
Hi sorry for the delayed reply,
I attached the project folder of a menu with only one text menuItem with some arabic text.
I used the foreign languages fork for adafruitGFX. Link: https://github.com/joeycastillo/Adafruit-GFX-Library
The first error that I got was that the library (gfxfont) was not available so i commented the line initializing the library.
Then I got the following:
Ar
duino: 1.8.15 (Mac OS X), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
WARNING: library Adafruit_GFX_Library claims to run on samd architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).
In file included from /Users/kabsah/Documents/Arduino/ArabicTest/ArabicTest/ArabicTest_menu.h:16:0,
from /Users/kabsah/Documents/Arduino/ArabicTest/ArabicTest/ArabicTest_menu.cpp:12:
tcMenuAdaFruitGfx.h:53:41: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
typedef struct ColorGfxMenuConfig<const GFXfont*> AdaColorGfxMenuConfig;
^
tcMenuAdaFruitGfx.h:53:49: error: template argument 1 is invalid
typedef struct ColorGfxMenuConfig<const GFXfont*> AdaColorGfxMenuConfig;
^
In file included from /Users/kabsah/Documents/Arduino/ArabicTest/ArabicTest/tcMenuAdaFruitGfx.cpp:16:0:
tcMenuAdaFruitGfx.h:53:41: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
typedef struct ColorGfxMenuConfig<const GFXfont*> AdaColorGfxMenuConfig;
^
tcMenuAdaFruitGfx.h:53:49: error: template argument 1 is invalid
typedef struct ColorGfxMenuConfig<const GFXfont*> AdaColorGfxMenuConfig;
^
In file included from /Users/kabsah/Documents/Arduino/ArabicTest/ArabicTest/ArabicTest_menu.h:16:0,
from /Users/kabsah/Documents/Arduino/ArabicTest/ArabicTest/ArabicTest.ino:1:
tcMenuAdaFruitGfx.h:53:41: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
typedef struct ColorGfxMenuConfig<const GFXfont*> AdaColorGfxMenuConfig;
^
tcMenuAdaFruitGfx.h:53:49: error: template argument 1 is invalid
typedef struct ColorGfxMenuConfig<const GFXfont*> AdaColorGfxMenuConfig;
^
/Users/kabsah/Documents/Arduino/ArabicTest/ArabicTest/tcMenuAdaFruitGfx.cpp: In member function 'virtual tcgfx::Coord AdafruitDrawable::textExtents(const void*, int, const char*, int*)':
tcMenuAdaFruitGfx.cpp:90:15: error: 'class Adafruit_GFX' has no member named 'setFont'
graphics->setFont(static_cast<const GFXfont *>(f));
^
tcMenuAdaFruitGfx.cpp:90:41: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
graphics->setFont(static_cast<const GFXfont *>(f));
^
tcMenuAdaFruitGfx.cpp:90:41: error: expected '>' before 'GFXfont'
tcMenuAdaFruitGfx.cpp:90:41: error: expected '(' before 'GFXfont'
tcMenuAdaFruitGfx.cpp:90:41: error: 'GFXfont' was not declared in this scope
tcMenuAdaFruitGfx.cpp:90:50: error: expected primary-expression before '>' token
graphics->setFont(static_cast<const GFXfont *>(f));
^
tcMenuAdaFruitGfx.cpp:92:28: error: expected primary-expression before ')' token
auto* font = (GFXfont *) f;
^
exit status 1
ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
|
 |
|
Thank you for the reply
I searched and found fork of the adafruit_gfx library that supports Unicode, but it seems incompatible with tcmenu code. And I am not sure what to change to make it work.
The library: https://github.com/joeycastillo/Adafruit-GFX-Library
I also tried the u8g2 for adafruit gfx: https://github.com/olikraus/U8g2_for_Adafruit_GFX but this also seems incompatible, and a gain I am not sure of what to do to make either work.
I have tried changing some of the line to solve the errors as they appear, but when I solve one I get another.
|
 |
|
Hello,
Recently found this library, and so far it is really helpful.
I am trying to have arabic characters (e.g. ??????) and the designer does not accept the characters. I worked around this by changing the name in the arduino code. But then on the display i get cryptic text.
I am using an ESP32 and st7735 LCD
I am not sure how to go about solving this.
Any help is appreciated
Thank you
|
 |
|