You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complete noob here. By miracle, I managed to get a test program running.
I'm using the 2.4 inch capacitive board 2432S024C.
When I received the board, it had a preloaded demo program running on it (I'm sure you are familiar - it is kinda like a web page).
I can't remember, but the CPU usage was fairly low when nothing is happening (if I recall correctly).
I then setup rzeldent /esp32-smartdisplay and loaded a simple test program to display a button from here.
#include <Arduino.h>
#include <esp32_smartdisplay.h>
static void btn_event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * btn = lv_event_get_target(e);
if(code == LV_EVENT_CLICKED) {
static uint8_t cnt = 0;
cnt++;
/*Get the first child of the button which is the label and change its text*/
lv_obj_t * label = lv_obj_get_child(btn, 0);
lv_label_set_text_fmt(label, "Button: %d", cnt);
}
}
/**
* Create a button with a label and react on click event.
*/
void lv_example_get_started_1(void)
{
lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button the current screen*/
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
lv_obj_set_size(btn, 120, 50); /*Set its size*/
lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_ALL, NULL); /*Assign a callback to the button*/
lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/
lv_label_set_text(label, "Button"); /*Set the labels text*/
lv_obj_center(label);
}
void setup()
{
smartdisplay_init();
auto disp = lv_disp_get_default();
// lv_disp_set_rotation(disp, LV_DISP_ROT_90);
// lv_disp_set_rotation(disp, LV_DISP_ROT_180);
// lv_disp_set_rotation(disp, LV_DISP_ROT_270);
lv_example_get_started_1();
}
void loop()
{
lv_timer_handler();
}
However, when it is sitting there doing nothing, it says it is using 70% CPU. Is this normal? Shouldn't it be using nothing, and waiting for an interrupt or somethin'?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Complete noob here. By miracle, I managed to get a test program running.
I'm using the 2.4 inch capacitive board 2432S024C.
When I received the board, it had a preloaded demo program running on it (I'm sure you are familiar - it is kinda like a web page).
I can't remember, but the CPU usage was fairly low when nothing is happening (if I recall correctly).
I then setup rzeldent /esp32-smartdisplay and loaded a simple test program to display a button from here.
However, when it is sitting there doing nothing, it says it is using 70% CPU. Is this normal? Shouldn't it be using nothing, and waiting for an interrupt or somethin'?
Beta Was this translation helpful? Give feedback.
All reactions