1# 2# An `lv_timer` to call periodically to set the angles of the arc 3# 4class ArcLoader(): 5 def __init__(self): 6 self.a = 270 7 8 def arc_loader_cb(self,tim,arc): 9 # print(tim,arc) 10 self.a += 5 11 12 arc.set_end_angle(self.a) 13 14 if self.a >= 270 + 360: 15 tim._del() 16 17 18# 19# Create an arc which acts as a loader. 20# 21 22# Create an Arc 23arc = lv.arc(lv.scr_act()) 24arc.set_bg_angles(0, 360) 25arc.set_angles(270, 270) 26arc.center() 27 28# create the loader 29arc_loader = ArcLoader() 30 31# Create an `lv_timer` to update the arc. 32 33timer = lv.timer_create_basic() 34timer.set_period(20) 35timer.set_cb(lambda src: arc_loader.arc_loader_cb(timer,arc)) 36 37 38