Description
I want the values from the sensor to be transmitted and displayed in the chart
What MCU/Processor/Board and compiler are you using?
ESP32-Wrower-B
What do you want to achieve?
correct display of values on the chart
What have you tried so far?
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.
The code block(s) should be formatted like:
lv_obj_t * chart_test(lv_obj_t * cont){
chart_one = lv_chart_create(cont, NULL);
lv_obj_set_size(chart_one, 270, 400);
lv_obj_align(chart_one, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);
lv_chart_set_type(chart_one, LV_CHART_TYPE_LINE);
lv_chart_set_series_opa(chart_one, LV_OPA_70);
lv_chart_set_series_width(chart_one, 4);
lv_chart_set_range(chart_one, 0, 100);
lv_chart_set_style(chart_one, LV_CHART_STYLE_MAIN, &lv_style_transp);
ser_one = lv_chart_add_series(chart_one, LV_COLOR_DEEPSKYBLUE);
lv_chart_set_next(chart_one, ser_one,0);
lv_chart_refresh(chart_one);
return chart_one;
}
from the sensor
lv_task_create( chart_refresher_task, 1024, LV_TASK_PRIO_MID, NULL);
void chart_refresher_task(void *p)
{
int arr[2];
sprintf(arr, "%d", (int)sensor_data.temp);
lv_chart_set_next(chart_1, ser_one,arr);
}
## Screenshot and/or video
If possible, add screenshots and/or videos about the current state.