Message |
|
For some time we'll keep 1.7 as the "Previous" branch in the designer UI. The 2.1.x designer UI has been fully tested against 1.7 libraries and plugins.
This means that you can take your time upgrading to 2.1 when you are ready.
To keep using 1.7:
1. From the menu select Edit -> General Settings
2. Go to the library versions tab.
3. Change the stream to "Previous".
4. In Arduino IDE, make sure you do not upgrade beyond the versions recommended in the designer.
|
|
|
If you've upgraded to 2.1 and are finding the flash usage is too high for your project, then there's a simple fix available from the code generator for LCD screens, choose "Uno - Low memory" in the properties.
Likewise, for AVR the SSD1306Ascii driver uses less memory at the expense of a bit of lost functonality.
Using either LCD in Uno mode, or the SSD1306Ascii plugin should result in very similar memory requirements to 1.7.
|
|
|
In fact I'll do a top level topic for the Uno mode, as some others could hit the same issue.
|
|
|
My code compiled, but is too big for the Arduino.
Are you using an AVR with 32K FLASH?
If so, you can select "Uno" mode in the LCD driver settings and save about 8K of flash. The old size for the dfRobot sketch was 22K and the new size with Uno ticked is around 24K.
If you're using an OLED, the SSD1306Ascii driver also fits well, almost unchanged to before. We have an example with two custom fonts and it uses about 25K FLASH.
|
|
|
Take a look at https://www.thecoderscorner.com/products/arduino-libraries/io-abstraction/switches-rotary-encoder-documentation/ where it has a section on rotary encoders. In summary there is a new optional parameter at the end of the set up method below:
void setupRotaryEncoderWithInterrupt(pinA, pinB, myCallback, QUARTER_CYCLE);
For now, go into your _menu.cpp file, and add that extra parameter. We've already raised an issue to add this as a checkbox in the rotary encoder plugin in the next release.
You'll have to be on a very recent IoAbstraction for this to work, as it's only just been kindly submitted and tested by ddd999
|
|
|
For now just hack the extra parameter on the end of the encoder setup in your project _menu.cpp
I’ll change and release the input plugin before the 2.1 library goes out tomorrow.
|
|
|
Yes there is a recently closed pull request in IoAbstraction on this, I’ll make sure it’s documented properly but take a look at the quarter cycle pull request or the IoAbstraction front page.
Answering on my phone at the moment but will reply again later.
|
|
|
We've released a release-candidate of tcMenu library for 2.1 as we've tested everything fully now, and are happy for people to start using it.
For those who want to try it now, please go ahead, but be aware the documentation is still being worked upon. Instructions are provided in the library release page. But basically it's a case of download the library and switch streams to BETA in Edit -> General Settings.
It will become a full release by the end of this week, once the documentation is ready.
https://github.com/davetcc/tcMenuLib/releases
|
|
|
UI 2.1.2 was released today with a few minor fixes, after a week of testing.
Available at https://github.com/davetcc/tcMenu/releases/
With this release of the UI fixing up a few bugs after even more heavy testing, we are imminently going to release tcMenu library V2.1. The plan is:
1. Let 2.1.2 bed in for a few days while we get the documentation ready on our site.
2. Flip the link and make library 2.1 current, and 1.7 the previous.
We don't want to repeat the 1.7 mistake where the documentation was not ready when we released it.
|
|
|
There’s a timer that takes me back to my screen ( or takeOverDisplay) . How can I set it, if is possible to set?
You can add a reset handler, see this link that describes how to handle the reset event: https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/renderer-take-over-display/
I noticed that every time the 'takeOverDisplay' function is called (for example exiting the menu), the encoder value is always 50.
When you take over the display, if you want to use the encoder, then you need to set the range and current value. Normally you'd do something like:
void myRenderingFunction() {
// do the drawing
}
void onTakeDisplay() {
// 1. take the display
renderer.takeOverDisplay(myRenderingFunction);
// 2. set the encoder range and current value
switches.getEncoder()->changePrecision(zeroBasedMaximum, currentValue);
}
|
|
|
Just to add, the item type pages will be updated with the new constructors once we've got 2.0 out. So in summary, not there yet, but coming really soon.
|
|
|
Thanks for letting us know it's working for you!
In 1.7 of the library the analog item's core settings are always stored in FLASH / PROGMEM.
However, in 2.0 (due out shortly, honestly this time, we keep saying it, but now it is going through final testing) you have the option of creating these core data structures in RAM instead. The easiest way to use it would be to create your own menu item as explained in this page: https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menu-item-types/. Towards the bottom of the page, there's a link to documentation for each item type.
In library 2.0 each of the constructors for menu items now has an extra boolean parameter at the end, it tells the menu item if the INFO data structure is in FLASH or RAM:
AnalogMenuItem(const AnalogMenuInfo* info, uint16_t defaultVal, MenuItem* next = nullptr, bool infoInPgm = INFO_LOCATION_PGM)
You would then insert the menu item where you want it using something similar to:
menuMgr.addMenuAfter(&menuExistingItem, &menuMyNewItem, triggerStructureChangedCallbacks);
|
|
|
how can I manage encoder button for a long time pressed? there's a built in function or I must create by myself?
When the button is held down it goes into a HELD state after about 1 second, if the repeat key parameter is set it will start repeating at this point. You can adjust the timing by changing the repeat / hold frequency passed in, see: https://www.thecoderscorner.com/products/arduino-libraries/io-abstraction/switches-rotary-encoder-documentation/.
there's a way to use encoder outside of Menu function for other purpose
In terms of getting encoder values there are two possibilities:
1. Simplest: in the takeOverDisplay rendering callback, the first parameter is the encoder's current value, the second parameter is the switch state (see enum). You can adjust the range of encoder values by changing the range that it currently represents, again, see the above link
enum RenderPressMode : uint8_t { RPRESS_NONE = 0, RPRESS_PRESSED = 1, RPRESS_HELD = 2 }
2. you register the rotary encoder and switch yourself (see the above link), then pass the values to menuManager when the menu is being displayed. For this see "Controlling the menu items manually" in https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menumanager-and-iteration/. Be aware that this (option 2) is a pretty advanced use case, and not used that often. There are possible assumptions that switches.getEncoder(0) is the menu encoder. Option 1 requires little on your side and works pretty well for many cases.
|
|
|
|
|
|
TcMenu designer 2.1 was released yesterday, this release goes back to a single code base, with builds for all platforms. You can watch the video
that describes the main changes and rationale.
It is fully compatible with the store version, and if there's anything you're missing from the new version, or there's a workflow that doesn't work properly, feel free to either raise an issue or report it here in the forum.
Release link: https://github.com/davetcc/tcMenu/releases/
|
|
|