refactor: scr -> screen, act->active, del->delete, remove in obj_clear_flag/state
This commit is contained in:
@@ -7,18 +7,18 @@
|
||||
void lv_example_led_1(void)
|
||||
{
|
||||
/*Create a LED and switch it OFF*/
|
||||
lv_obj_t * led1 = lv_led_create(lv_scr_act());
|
||||
lv_obj_t * led1 = lv_led_create(lv_screen_active());
|
||||
lv_obj_align(led1, LV_ALIGN_CENTER, -80, 0);
|
||||
lv_led_off(led1);
|
||||
|
||||
/*Copy the previous LED and set a brightness*/
|
||||
lv_obj_t * led2 = lv_led_create(lv_scr_act());
|
||||
lv_obj_t * led2 = lv_led_create(lv_screen_active());
|
||||
lv_obj_align(led2, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_led_set_brightness(led2, 150);
|
||||
lv_led_set_color(led2, lv_palette_main(LV_PALETTE_RED));
|
||||
|
||||
/*Copy the previous LED and switch it ON*/
|
||||
lv_obj_t * led3 = lv_led_create(lv_scr_act());
|
||||
lv_obj_t * led3 = lv_led_create(lv_screen_active());
|
||||
lv_obj_align(led3, LV_ALIGN_CENTER, 80, 0);
|
||||
lv_led_on(led3);
|
||||
}
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
#
|
||||
|
||||
# Create a LED and switch it OFF
|
||||
led1 = lv.led(lv.scr_act())
|
||||
led1 = lv.led(lv.screen_active())
|
||||
led1.align(lv.ALIGN.CENTER, -80, 0)
|
||||
led1.off()
|
||||
|
||||
# Copy the previous LED and set a brightness
|
||||
led2 = lv.led(lv.scr_act())
|
||||
led2 = lv.led(lv.screen_active())
|
||||
led2.align(lv.ALIGN.CENTER, 0, 0)
|
||||
led2.set_brightness(150)
|
||||
led2.set_color(lv.palette_main(lv.PALETTE.RED))
|
||||
|
||||
# Copy the previous LED and switch it ON
|
||||
led3 = lv.led(lv.scr_act())
|
||||
led3 = lv.led(lv.screen_active())
|
||||
led3.align(lv.ALIGN.CENTER, 80, 0)
|
||||
led3.on()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user