I have #if 0’'ed that code for the time being. Thus avoiding any hint of out of memory for the time being. So I am back to concentrating on just the bar. I would like to display it.
Am I having a problem because I didn’t establish a theme?
Or because I didn’t specify a size for the bar?
Presumably I am not having my whiteout because of the way I’m calling the lv_tick_inc() and lv_task_handler()?
// Now walk the value up and down 0 to 30
for (int count=0; count < 31; count++ )
{
lv_bar_set_value( bar, count, LV_ANIM_OFF );
// Echo the value as a number
char outputCount[ 10 ];
sprintf( outputCount, "%d", count );
lv_label_set_text( labelNumber, outputCount );
delay_ms( 750 );
}
for (int count=30; count >= 0; count-- )
{
lv_bar_set_value( bar, count, LV_ANIM_OFF );
// Echo the value as a number
char outputCount[ 10 ];
sprintf( outputCount, "%d", count );
lv_label_set_text( labelNumber, outputCount );
delay_ms( 750 );
}
#endif
while (1)
{
lv_task_handler();
lv_tick_inc(1);
delay_ms(1);
}
Now I have the bar drawing YAY but the label that I’m trying to display above the bar, is not legible. It looks like I’m getting the top half of the 25 that I’m trying to display. I have LV_FONT_ROBOTO 16 set to 1 so presumably I’m using that. Should I be able to give alignment of the CENTER to the text? Could I be running into the default padding on the bar?
The partial label is appearing at the upper left hand corner (0,0). It may be a driver issue. I am seeing the top halfs I think of the numbers. I gave the bar the BOTTOM_MID alignment so it’s way out of the way. Do you think I need to implement a rounding routine?
I’m not sure. You’ll have to do some experimenting and see if you can find what the problem is. Nothing appears to be wrong with the loop you showed me.
Now I’m putting the label on the screen by itself with this code:
lv_obj_t *labelNumber = lv_label_create( scr, NULL );
lv_obj_set_size( labelNumber, 10, 20 );
lv_label_set_align( labelNumber, LV_LABEL_ALIGN_CENTER );
lv_label_set_text( labelNumber, “25” );
And I am seeing the “25”, but in the upper left hand corner. Is there a way to move the display?
Bumping this to hopefully get some additional exposure. Like elite and LAnsell, I’m facing an issue where my color struct always returns black pixels. I have the mono theme set to 1 via the flag in lv_conf and I disabled the non-mono theme flags, but I’m not sure if there’s anything else I should have done to properly initialize. Elite, were you able to find a solution?