1# 2# Create a pie chart 3# 4 5meter = lv.meter(lv.scr_act()) 6 7# Remove the background and the circle from the middle 8meter.remove_style(None, lv.PART.MAIN) 9meter.remove_style(None, lv.PART.INDICATOR) 10 11meter.set_size(200, 200) 12meter.center() 13 14# Add a scale first with no ticks. 15scale = meter.add_scale() 16meter.set_scale_ticks(scale, 0, 0, 0, lv.color_black()) 17meter.set_scale_range(scale, 0, 100, 360, 0) 18 19# Add a three arc indicator* 20indic_w = 100 21indic1 = meter.add_arc(scale, indic_w,lv.palette_main(lv.PALETTE.ORANGE), 0) 22meter.set_indicator_start_value(indic1, 0) 23meter.set_indicator_end_value(indic1, 40) 24 25indic2 = meter.add_arc(scale, indic_w, lv.palette_main(lv.PALETTE.YELLOW), 0) 26meter.set_indicator_start_value(indic2, 40) # Start from the previous 27meter.set_indicator_end_value(indic2, 80) 28 29indic3 = meter.add_arc(scale, indic_w, lv.palette_main(lv.PALETTE.DEEP_ORANGE), 0) 30meter.set_indicator_start_value(indic3, 80) # Start from the previous 31meter.set_indicator_end_value(indic3, 100) 32 33