Message |
|
Thanks a lot Dave.
The problem here is that I hardly understand the way tcMenu is engineered, because object oriented programming is almost new for me. I trust tcMenuDesigner and the libraries, and then I add my code (C without ++).
For that reason, I don't feel comfortable suggesting documentation improvements.
|
|
|
Dear Dave.
I've inserted in setupMenu() the call to Wire.begin() just before the call to gfx.begin().
That has resolved the problem.
What I don't understand is why Wire.begin was not necessary in the previous project and now it is.
Where is the option to disable the low latency driver in the tcMenu Designer, anyhow?
THANKS for your help !!!
|
|
|
Also, is there a Wire.begin in the sketch somewhere?
No, neither in the old project nor this one there is a Wire.begin()
There is and three has been before gfx.begin()
Maybe something along the line of clearing the display and then printing something anywhere on the display and waiting for a few seconds. Dont forget to flush the buffer after printing something though!
I have added to the generated code, in the PROJECTNAME_main.cpp this
void setup() {
Serial.begin(115200);
printf("\n\nCalling setupMenu()...");
setupMenu();
printf(" OK.\n");
}
void loop() {
taskManager.runLoop();
renderer.takeOverDisplay(fnTakeOver);
}
void CALLBACK_FUNCTION fnTakeOver(unsigned int encoderValue, RenderPressMode clicked) {
if (encoderValue != 1)
printf("encoder: %d\tclicked: %d\n", encoderValue, clicked);
gfx.drawCircle(20, 20, 18, true);
renderer.giveBackDisplay();
}
No circle is drawn, and if I touch the sensors you can see changes in encoderValue over the USB monitor (printf), so it demonstrates fnTakeOver is called periodically (I don't print nothing if encoder==1):
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[ . . .]
Calling setupMenu()... OK.
encoder: 2 clicked: 0
encoder: 0 clicked: 0
Sorry if I don't know exactly how to draw a circle. My programmer skills are very limited.
|
|
|
Hello.
I was using tcMenu 1.7.1 (tcMenu Designer 2.0.beta) and all was working.
Now, I have updated PlatformIO library versions to tcMenu 2.2.3 (tcMenu Designer 2.2.3) and the project compiles right, but the OLED display is blank. What am I doing wrong? The designer project is very simple: Only a display (U8G2_SSD1306_128X64_NONAME_F_HW_I2C) and a theme (some pictures on attachments). The .emf is also attached.
I can confirm that the code is working because some printf are seen on the USB serial port console.
Any hint will be welcome. Thanks.
|
|
|
Don't worry. You are offering it free, that is the point.
|
|
|
OK, I'm going to update the versions.
I have a question if you don't mind...
I'm using PlatformIO. In that IDE, your library appears, but the version I can insert is 2.1.3
In github I can see 2.2.3 ( https://github.com/davetcc/tcMenuLib)
Do you reccomend installing 2.1.3 from the IDE or add manually the last version available on github?
Thanks again for your work, Dave.
|
|
|
It seems to be a solution in the tcMenuLib project (I mean in the software that constructs the source code for the embedded processor)
Any of you could think on something to change in the embedded code, or it is too difficult?
I've seen that the file "tcMenuU8g2.cpp" (constructed by the application) has U8g2MenuRenderer::renderTitleArea().
It copies in a buffer the title menu (applicationInfo.name) but I don't have an strategic plan. Any help will be welcome.
|
|
|
Thanks Dave.
Actually, maybe you finish tcMenu 2.0 before I finish my program. But now I understand a bit better the library.
|
|
|
Hi Dave.
I have a display with two colors. The first 16 lines are yellow and the rest are blue. Also there is a gap between the two zones.
All the menus are presented fine, because the title in inverse seems to have an height of 14 pixels. See photo "menu.jpg".
When a BaseDialog is presented, the height of the title ( dlg->show ) seems to have 12 pixels. When a second line text is presented wit dlg->copyIntoBuffer, it is mixed between yellow and blue. Also a separation between the two colors makes the text to be "broken". See photo "Dialog.jpg"
I think one possible solution is to change the "title" (dlg->show) haight from 12 to 14 or maybe 16. Is it possible?
Alternatively, how can I send a Carriage Return in dlg->copyIntoBuffer to not use that fisrst line and be sure to be only on the blue zone? I've tried to send "\n" but with no luck.
Thanks a lot.
Code use to make Dialog.jpg photo
const char allSavedPgm[] PROGMEM = "Salvando Configuracion...";
void CALLBACK_FUNCTION fnSalvar(int id) {
BaseDialog* dlg = renderer.getDialog();
if(dlg) {
dlg->setButtons(BTNTYPE_NONE, BTNTYPE_CLOSE);
dlg->show(allSavedPgm, false); // false = shows only on device
dlg->copyIntoBuffer("...");
dlg->copyIntoBuffer("Salvada !");
}
}
|
|
|
Thanks Dave (sorry for calling you David before)
|
|
|
Dear David.
In my project I would need to keep the SSD1306 display off (to not emit light at night) until some key is pressed. That would initalize a countdown and would clear the display when reaching zero. The countdown would initialize when some key is pressed.
Could you give me some reccomendations?
* Function to clear the display.
* Function to enable the display again.
* Function to be called on any touchpad key pressed.
Thanks in advance.
And thanks for the touch sensor keys implementation !!!!!!!
|
|
|
I have understood that the correct election is the <<Control menu with UP/DOWN buttons>>. All is working as expected, I think.
The only problem I've found is that the up and down buttons seems to be interchanged. If I push UP, the little arrow in the menu goes DOWN.
Maybe another issue... In the desginer, when you select ESP WIFI as a remote capability, the limit of the listen port is 65355. I think it shuld be the maximum 16 bit value (65535, 2^16-1)
Thanks for your work.
|
|
|
Dear Dave.
I have been a bit busy lately and couldn't test your solution.
Just to be sure... In the Rotary Encoder configuration I must write "esp32Touch" in the cell marked in the picture.
The code is as follow (modified after the code generation)
void setupMenu() {
prepareBasicU8x8Config(gfxConfig);
gfx.begin();
renderer.setGraphicsDevice(&gfx, &gfxConfig);
ESP32TouchKeysAbstraction* esp32Touch = \
new ESP32TouchKeysAbstraction(TOUCH_threshold, TOUCH_HVOLT_2V7, TOUCH_LVOLT_0V5, TOUCH_HVOLT_ATTEN_1V);
switches.initialise(esp32Touch, false);
menuMgr.initForEncoder(&renderer, &menuCalefaccion, 6, 8, 4);
}
The numbers 6, 8 and 4 in the last line are the touch sensors (not pins numbers)
Thanks for your support!!!
|
|
|
Thnaks a lot Dave.
I'm afraid I'm going to need some time. After trying to install the 2.0.0 version of the generator the app does not work any more (I mean 1.7.0)
Now I cannot generate the structure to test.
|
|
|
Don't worry, I know you are doing your best.
I've tried to understand your code, but honestly objects are not my strong point.
Good weekend.
|
|
|