[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

How to clear the display. RSS feed
Forum Index » tcMenu Arduinio library
Author Message
chirrindulari


Joined: Jan 23, 2021
Messages: 22
Offline
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 !!!!!!!
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
What I would do is look at the documentation around taking over the display. Many of the examples also take over the display too, so it's easy to work out how to do it.

Once you have control of the display you can call any function on the display yourself, but you should only do so in the rendering callback or instance of CustomDrawing that you provide to the renderer.

Both the OO - CustomDrawing and functional - renderingCallback methods are fully documented here, and again can be found in many examples. In the examples we usually make the menu take back over when the button is pressed, but you could also detect any change in the rotary encoder too, so then any button would wake it up. Of course, you could also do it many different ways as well, but I think this would be easiest.

Documentation for take over display:

https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/renderer-take-over-display/

Also take a look at the examples, EG:

https://github.com/davetcc/tcMenuLib/blob/6b049aaa2e9ad4c8a3035280c28185aa812c892b/examples/takeOverDisplay/takeOverDisplay.ino#L191
chirrindulari


Joined: Jan 23, 2021
Messages: 22
Offline
Thanks Dave (sorry for calling you David before)
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.