rpm
April 7, 2019, 9:12pm
2
A rectangle can be made with a base object. Here is @jpearman ’s post with a simple function for drawing one with LVGL.
Here is the doc for a line object.
From @ theol0403 LVGL is planing on supporting canvas drawing in the next version.
However, I really don’t understand the desire to draw at such a low level for Auton selection and debugging. LVGL has a rich set of feature using tabs, buttons and call backs, gauges and sliders. You can create multiple regions of the screen for data presentation and user input. Here are some of the threads that show how powerful it is.
printf to the screen:
how to display data with PROS like Brain.Screen.printAt() of vexcode
PROS is using Atom as its editor, which is much more conventient to use. but i can find PROS api do print simple things, it has LVGL, but not that friendly to use. and the Legacy LCD Emulator is not that cool .
thanks
Examples:
Yes, a label is what I would use to print text. Before you try to mess around with c strings, which require buffers and sprintf, try to give C++ strings a go.
std::string text = "Value: " + std::to_string(value);
lv_label_set_text(label, text.c_str());
or
std::stringstream text;
text << "Value: " << value;
lv_label_set_text(label, text.str().c_str());
c_str() is necessary to convert the c++ string to the required const char*
One reason why lv_set_style(lv_scr_act(), &style) might not have w…
extra fonts:
Yes, that was to keep the default binary size slim.
Shameless plug:
I have a library that would allow people to add more fonts to PROS. Currently I’ve added support for some CJK fonts, but I’m open to pull requests that add other fonts
2 Likes