69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
##############################################
|
|
## ##
|
|
## filename: 1bar_1display_scripts.yaml ##
|
|
## description: Specific pre-defined ##
|
|
## scripts for 1 BAR 1 Display setup ##
|
|
## ##
|
|
##############################################
|
|
|
|
script:
|
|
######################
|
|
### update scripts ###
|
|
######################
|
|
- id: update_bar1_left
|
|
then:
|
|
- lambda: |-
|
|
id(cs_pin_bar1_left).turn_on(); // <<
|
|
id(cs_pin_bar1_right).turn_off();
|
|
id(bar_display).clear();
|
|
id(bar_display).set_rotation(display::DisplayRotation::DISPLAY_ROTATION_270_DEGREES);
|
|
id(bar1_left_draw).execute();
|
|
id(bar_display).update();
|
|
delay(2);
|
|
id(cs_pin_bar1_left).turn_off();
|
|
- id: update_bar1_right
|
|
then:
|
|
- lambda: |-
|
|
id(cs_pin_bar1_left).turn_off();
|
|
id(cs_pin_bar1_right).turn_on(); // <<
|
|
id(bar_display).clear();
|
|
id(bar_display).set_rotation(display::DisplayRotation::DISPLAY_ROTATION_90_DEGREES);
|
|
id(bar1_right_draw).execute();
|
|
id(bar_display).update();
|
|
delay(2);
|
|
id(cs_pin_bar1_right).turn_off();
|
|
##################################
|
|
### setup mini display scripts ###
|
|
##################################
|
|
- id: setup_bar_displays
|
|
then:
|
|
- lambda: |-
|
|
id(cs_pin_bar1_left).turn_on();
|
|
id(bar_display).setup();
|
|
id(cs_pin_bar1_left).turn_off();
|
|
delay(5);
|
|
id(cs_pin_bar1_right).turn_on();
|
|
id(bar_display).setup();
|
|
id(cs_pin_bar1_right).turn_off();
|
|
####################
|
|
### draw scripts ###
|
|
####################
|
|
- id: bar1_left_draw
|
|
then:
|
|
- id: bar1_right_draw
|
|
then:
|
|
##############################
|
|
### other handling scripts ###
|
|
##############################
|
|
- id: update_main
|
|
then:
|
|
- component.update: main_display
|
|
- id: update_all
|
|
then:
|
|
- component.update: main_display
|
|
- delay: 0.1s
|
|
- script.execute: update_bar1_left
|
|
- delay: 0.1s
|
|
- script.execute: update_bar1_right
|
|
- delay: 0.1s
|