Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the FAQ and read the relevant part of the documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
Button matrix colors
What MCU/Processor/Board and compiler are you using?
Code::Blocks
What LVGL version are you using?
lvgl by kisvegabor version 9.2
What do you want to achieve?
I know that buttons in a matrix all have the same color, but how do I set that color?
What have you tried so far?
Trawled through LVGL documentation, searched this forum, searched the web, but
I cannot find an answer that makes sense or works.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
I have inserted my code below as instructed, but it does not look right.
My apologies if I have got this wrong.
Anyway, the code below runs OK, but I’d like to know what I need to put in
the commented line that starts // lv_obj_set_style_???
The code block(s) should be formatted like:
/*
lv_obj_t * buttons[15];
lv_obj_t * my_matrix;
// ************ Button Matrix *************
my_matrix = lv_buttonmatrix_create(lv_screen_active());
lv_buttonmatrix_set_map (my_matrix, btnm_map);
lv_obj_remove_style_all (my_matrix);
lv_obj_set_size (my_matrix,370,250);
lv_obj_set_style_bg_color (my_matrix,Black, 0);
// lv_obj_set_style_?????? What needs to go here to set colour of the buttons?
lv_obj_add_event_cb (my_matrix, my_matrix_event, LV_EVENT_ALL, NULL);
*/
## Screenshot and/or video
If possible, add screenshots and/or videos about the current state.