Author |
Message |
21/10/2020 08:54:39
|
#1
|
NewOne
Joined: Oct 21, 2020
Messages: 19
Offline
|
Hi, i found this library in the net and i am very impressed.
So i installed the Windows10 App, everything works fine, but i didn't found the way to generate code. So i installed the Windows7 Version, everything is fine now.
I have created a menu, generated the code and added the files to my Arduino project.
Compiling is ok, no errors.
And now ? How can i start the menu on my LCD (16x2) ? What function musst i call ? Is there a "StartMenu()" oder anything like this ?
|
|
|
21/10/2020 13:03:51
|
#2
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
So i installed the Windows10 App, everything works fine, but i didn't found the way to generate code
On the Windows 10 version the generate button is on the tool bar, looks like a download symbol. But it only enables when you save the menu for the first time. We'll try the process ourselves again and maybe see if we could make it clearer. thanks for the feedback on this.
And now ? How can i start the menu on my LCD (16x2) ? What function musst i call
By default the menu should start immediately. You actually have to turn the menu off when you don't want it to display.
What I normally do for a new board, is just to get LiquidCrystalIO working with one of the examples first, there's an example for DfRobot and for I2C, you can customise it to your arrangements in a test sketch. Once that's working it's usually easy to get the rest working.
Hope that helps.
|
|
|
21/10/2020 19:02:23
|
#3
|
NewOne
Joined: Oct 21, 2020
Messages: 19
Offline
|
Thanks for trying to help me!
This is my Arduino Code
#include "tcMenu_menu.h"
void setup() {
// put your setup code here, to run once:
setupMenu();
}
void loop() {
// put your main code here, to run repeatedly:
taskManager.runLoop();
}
Nothing happens on the display ....
|
|
|
22/10/2020 07:19:37
|
#4
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
As I said in the previous reply, you need to get code that is working with your display first.
I assume you have a 16x2 LCD display according to your first post. In that case, the first thing you have to determine is how that display is connected to the Arduino device. EG: Is it connected via I2C or is it connected directly to pins on the Arduino.
I'm assuming you are seeing boxes on the first line of the display, which would normally mean it is not configured properly. If you can't see anything at all, it is possible the contrast potentiometer is set wrongly.
---
Step 1: Does the display work when you use one of the LiquidCrystalIO or LiquidCrystal examples.
For example for I2C connection use this example and read the comments carefully on how to configure it: File > Examples > LiquidCrystalIO > HelloI2c
For example for DfRobot LCD shield: File > Examples > LiquidCrystalIO > HelloWorld
For any other pin configuration (you'll need to change the pins manually in the example): File > Examples > LiquidCrystalIO > Display
---
Step 2: To help you any further, you'll need to describe the exact set up here. EG what type of LCD are you using? How is it connected to the Arduino? The outcome of getting the LCD to work in step 1
Thanks
Dave
|
|
|
22/10/2020 16:52:40
|
#5
|
NewOne
Joined: Oct 21, 2020
Messages: 19
Offline
|
Hi,
i am using the DfRobotShield. The <LiquidCrystal> Library works well.
I want to try an example, but in the DesignerApp is no example available.
And i selected this shield by Code generation. Now, i have 4 additional files:tcMenu_menu.h, tcMenu_menu.cpp, tcMenuLiquidCrystal.h and tcMenuLiquidCrystal.cpp.
I added the files to my sketch, it compiles with no errors. But when upload it to the Arduino, nothing happens on the display
This is my skecth
#include "tcMenu_menu.h"
void setup() {
// put your setup code here, to run once:
setupMenu();
}
void loop() {
// put your main code here, to run repeatedly:
taskManager.runLoop();
}
|
|
|
23/10/2020 14:36:33
|
#6
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
The example located in examples/analogDfRobot example should work out of the box with any regular dfRobot shield. It just reads analog in and renders it into the menu. Please load this example into your IDE and try to upload it. You shouldn't even need to run the code generator in tcMenuDesigner as it's pre-generated. If this does not work, please send me:
* a photo that shows the situation on the shield with the sketch running
* the output of the Arduino compiler and the version of tcMenu library that you are using
* the hardware that you are using and how it's wired up.
Also, note that if you are using the regular Arduino IDE that it does not refresh files, so if you generate a menu while it's open in Arduino IDE, it will not update. This is a limitation of Arduino IDE and not tcMenu.
Thanks,
Dave
|
|
|
23/10/2020 17:13:09
|
#7
|
NewOne
Joined: Oct 21, 2020
Messages: 19
Offline
|
Everything is fine now.
Some of my libraries where not up to date, that was the reason that i can't find the Button for Code Generation, and that was also the reason that i could not see any example.
And at least, i didn't noticed that a .Ino file was generated!!! So i wrote my own Sketch.
The example is working now...
But one question:
In the ROM Layout, i find something like "x-y aaa". What is "a" and "b" standing for ?
Begin and end of the Place in the ROM ? Begin and size of the place in the ROM ?
If i use the "auto" button, i always get "2-2", for every entry in the table
|
|
|
24/10/2020 10:06:06
|
#8
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
Great news that you've got it working now.
In the ROM Layout window, the a - b are the start and size of the EEPROM space that the item would take.
Lets say that you generated a text menu item that was 10 characters long, and set the EEPROM address to 20. It would start at location 20 and take 10 bytes of EEPROM. The rom layout dialog is trying to show you this graphically, so you can see how the EEPROM storage is organised, if that makes sense.
These positions in EEPROM are used in the load() and save() functions of menu manager to read and write the current value. There's many different ways of using EEPROM, most are shown in the examples. If you are using an AVR based board (Uno, Mega2560 etc) then you can:
Add this include:
#include <EepromAbstraction.h>
Add this global variable in your sketch:
AvrEeprom eeprom;
Lastly, in setup after setupMenu is called:
menuMgr.load(eeprom);
Then at some point, (to start with maybe in the callback of an action item)
menuMgr.save(eeprom);
|
|
|
24/10/2020 14:59:16
|
#9
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
If i use the "auto" button, i always get "2-2", for every entry in the table
Not all menu types can be saved to EEPROM, for example, SubMenuItem, ActionMenuItem and FloatMenuItem cannot save to EEPROM. Float menu item is only designed for readonly values, for editable values, use AnalogMenuItem as it always provides an exact value.
In the newer Windows Store version you cannot set an EEPROM value for those types. Could you tell us what was wrong when you tried the Windows 10 version?
|
|
|
|