Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » rotary encoder setup

Author: lololo
13/05/2020 14:13:57
Hello,

First of all thank you for adding the ssd1306ascii library. I was just waiting for the addition of this library to test tcmenu.

I don't quite understand if you have to initialize the rotary encoder in the setup? I just put the pins in tcmenu before generating the code. it works (but not very well) and the click does not work. ?!

I also wanted to know if it is possible do not display the name of the application on the screen?

and one thing that would be nice, is to be able to enter Setup mode by making a double click (which would make it possible do not display setup on the main screen and win a line)

thank you in advance for your help

Author: davetcc
13/05/2020 17:44:49
 
lololo wrote:I don't quite understand if you have to initialize the rotary encoder in the setup? I just put the pins in tcmenu before generating the code. it works (but not very well) and the click does not work. ?!


There should be no additional configuration needed beyond what you've defined in the code generator. Which board are you using? Are you using long wire runs? Does the board allow for input pull up on those pins.

Ensure to start with you have interrupt_switches set to false and pull up logic set to true. Also don't forget that PIN A of the encoder has to be an interrupt capable pin, either on an IO expander or Arduino Pin. I'd start out with an Arduino pin and build from there.

lololo wrote:I also wanted to know if it is possible do not display the name of the application on the screen?


Not out of the box at the moment. Don't forget that the rendering class is nothing more than a file placed in your directory. Longer-term you could customize it, there's even a guide for that.

lololo wrote:and one thing that would be nice, is to be able to enter Setup mode by making a double click (which would make it possible do not display setup on the main screen and win a line)


You can do this, take a look at the takeOverDisplay example. It starts in a custom screen, then goes into the menu when clicked. You can essentially choose when your code or the menu code controls the screen using takeOverDisplay and giveBackDisplay. When you call "take over display", you provide a function callback that will be called several times a second to refresh the display if needed. Similar to a game loop basically. Never render to the display outside of this function.

Hope that helps,
Dave.


Author: davetcc
13/05/2020 17:56:49
I've also just set 1.4.3 of the plugins (containing ssd1306Ascii driver) to be the standard now, so you can go back to using the STABLE release stream if you like.




Register / Login  |  Desktop view  |  Jump to top of page