-
Hi again, I am using ESP8266, SDA1306 OLED diplay. I can takeover the display and giveback to tcMenu when needed. I want to use a sonor sensor to display the value on the dashboard. Usually we would put that code in the Loop so that the display updates continuously. But I am not sure how to implement the same using tcMenu framework. Looking forward for your kind support. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You have a few possibilities here, from taking over the display and doing your own drawing, to using a dashboard. Take a look at the examples, they show all the various ways of handling display take-over. In short, instead of writing your code in loop, you'd write your code in the callback you setup with takeOverDisplay when the renderer calls you. Many of the examples show off this functionality, here are a few that spring to mind: In stm32DuinoDemo it uses the object-oriented way of working. In analogJoystick1306Ascii it uses a callback function that is called frequently to to the drawing. Lastly, in picoAdafruitDashboard it uses the dashboard approach. |
Beta Was this translation helpful? Give feedback.
-
Hi @davetcc , Please note; ShowHome is actually the homescreen/ dashboard which I want to display on boot or when the menu is idle/ exit from menu. The code given below; `#include "Water_Tank_Multi_Mode_menu.h" unsigned char data[4] = {}; bool homeShowing; void setup() { void loop() { void CALLBACK_FUNCTION saveSettingsExit(int id) { void ReadUltrasonic() { Ultrasonic_Sensor.flush(); if (data[0] == 0xff) { void ShowHome(unsigned int value, RenderPressMode mode) { gfx.clearBuffer(); // clear the internal memory |
Beta Was this translation helpful? Give feedback.
You have a few possibilities here, from taking over the display and doing your own drawing, to using a dashboard.
Take a look at the examples, they show all the various ways of handling display take-over. In short, instead of writing your code in loop, you'd write your code in the callback you setup with takeOverDisplay when the renderer calls you. Many of the examples show off this functionality, here are a few that spring to mind:
In stm32DuinoDemo it uses the object-oriented way of working.
In analogJoystick1306Ascii it uses a callback function that is called frequently to to the drawing.
Lastly, in picoAdafruitDashboard it uses the dashboard approach.