This commit is contained in:
Martijn
2024-11-16 18:57:09 +01:00
parent 89a4c0c026
commit 16799c944b
2 changed files with 67 additions and 22 deletions
+36 -3
View File
@@ -18,6 +18,27 @@ mcp23008:
i2c_id: buttons i2c_id: buttons
address: 0x23 address: 0x23
output:
# - platform: mcp23xxx
# mcp23xxx_id: base_J2
# pin: 1
# id: cs_pin_1
# - platform: mcp23xxx
# mcp23xxx_id: base_J2
# pin: 5
# id: cs_pin_2
- platform: mcp23xxx
mcp23xxx_id: base_J3
pin: 1
id: cs_pin_3
- platform: mcp23xxx
mcp23xxx_id: base_J3
pin: 5
id: cs_pin_4
binary_sensor: binary_sensor:
############################ ############################
### Buttons Main Display ### ### Buttons Main Display ###
@@ -139,14 +160,26 @@ display:
################## ##################
### BAR module ### ### BAR module ###
################## ##################
# - id: bar_display
# platform: ili9xxx
# model: ST7735
# color_order: bgr
# update_interval: never
# dc_pin:
# number: GPIO37
# allow_other_uses: true
# invert_colors: false
# show_test_card: false
# dimensions:
# height: 160
# width: 80
# offset_width: 24
- id: bar_display - id: bar_display
platform: ili9xxx platform: ili9xxx
model: ST7735 model: ST7735
color_order: bgr color_order: bgr
update_interval: never update_interval: never
dc_pin: dc_pin: GPIO37
number: GPIO37
allow_other_uses: true
invert_colors: false invert_colors: false
show_test_card: false show_test_card: false
dimensions: dimensions:
+31 -19
View File
@@ -6,26 +6,35 @@
## ## ## ##
############################################## ##############################################
globals: # globals:
- id: cs_pin # - id: cs_pin
type: GPIOPin* # type: GPIOPin*
script: script:
- id: update_bars - id: update_display_1
then: then:
- lambda: |- - lambda: |-
// update display left: id(cs_pin_3).write(false); // CS actief voor Display 1
id(cs_pin) = new GPIOPin(id(display_bar1_left)); id(cs_pin_4).write(true);
id(bar_display).set_cs_pin(id(((cs_pin))); // id(cs_pin_3).write(true);
id(bar_display).set_rotation(DisplayRotation::DISPLAY_ROTATION_270_DEGREES); // id(cs_pin_4).write(true);
id(bar1_left_page1).execute();
id(bar_display).update(); id(bar1_left_page1).execute()
// update display right: id(bar_display).update();
id(cs_pin) = new GPIOPin(id(display_bar1_right)); delay(10); // Optioneel voor stabiliteit
id(bar_display).set_cs_pin(id((cs_pin))); id(cs_pin_1).write(true); // CS inactief na update
id(bar_display).set_rotation(DisplayRotation::DISPLAY_ROTATION_90_DEGREES); - id: update_display_2
id(bar1_right_page1).execute(); then:
id(bar_display).update(); - lambda: |-
id(cs_pin_3).write(true);
id(cs_pin_4).write(false); // CS actief voor Display 2
// id(cs_pin_3).write(true);
// id(cs_pin_4).write(true);
id(bar1_right_page1).execute()
id(bar_display).update();
delay(10); // Optioneel voor stabiliteit
id(cs_pin_2).write(true); // CS inactief na update
- id: bar1_left_page1 - id: bar1_left_page1
then: then:
- lambda: |- - lambda: |-
@@ -40,7 +49,10 @@ script:
- id: update_all - id: update_all
then: then:
- component.update: main_display - component.update: main_display
- component.update: bar_display - script.execute: update_display_1
- script.execute: update_display_2
# - script.execute: update_display_3
# - script.execute: update_display_4
- id: next_page_main - id: next_page_main
then: then:
- display.page.show_next: main_display - display.page.show_next: main_display
@@ -48,7 +60,7 @@ script:
- id: next_page_all - id: next_page_all
then: then:
- display.page.show_next: main_display - display.page.show_next: main_display
- display.page.show_next: bar_display # - display.page.show_next: bar_display
- script.execute: update_all - script.execute: update_all
- id: prev_page_main - id: prev_page_main
then: then:
@@ -57,5 +69,5 @@ script:
- id: prev_page_all - id: prev_page_all
then: then:
- display.page.show_previous: main_display - display.page.show_previous: main_display
- display.page.show_previous: bar_display # - display.page.show_previous: bar_display
- script.execute: update_all - script.execute: update_all