Update for V2 PCB with V1 housing
This commit is contained in:
@@ -1,167 +0,0 @@
|
||||
############################################
|
||||
## ##
|
||||
## filename: 1bar_1display.yaml ##
|
||||
## description: Specific configuration ##
|
||||
## for the 1 BAR 1 Display setup ##
|
||||
## ##
|
||||
############################################
|
||||
|
||||
packages:
|
||||
base: !include base.yaml
|
||||
scripts: !include 1bar_1display_scripts.yaml
|
||||
|
||||
esphome:
|
||||
on_boot:
|
||||
priority: -100
|
||||
then:
|
||||
- script.execute: setup_bar_displays
|
||||
- script.execute: update_bar1_left
|
||||
- script.execute: update_bar1_right
|
||||
|
||||
mcp23008:
|
||||
- id: 'base_J2'
|
||||
i2c_id: buttons
|
||||
address: 0x22
|
||||
- id: 'base_J3'
|
||||
i2c_id: buttons
|
||||
address: 0x23
|
||||
|
||||
binary_sensor:
|
||||
############################
|
||||
### Buttons Main Display ###
|
||||
############################
|
||||
- platform: gpio
|
||||
id: 'main_display_btn_left'
|
||||
name: "Main Display button Left"
|
||||
pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 6
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
- platform: gpio
|
||||
id: 'main_display_btn_right'
|
||||
name: "Main Display button Right"
|
||||
pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 2
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
|
||||
############################
|
||||
### Buttons BAR module 1 ###
|
||||
############################
|
||||
- platform: gpio
|
||||
id: 'bar1_btn_left'
|
||||
name: "BAR 1 button Left"
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 6
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
- platform: gpio
|
||||
id: 'bar1_btn_right'
|
||||
name: "BAR 1 button Right"
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 2
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
|
||||
light:
|
||||
- id: !extend neopixels
|
||||
num_leds: 5
|
||||
############################
|
||||
### RGB LED's BAR module ###
|
||||
############################
|
||||
- platform: partition
|
||||
name: "BAR 1 Left RGB Front"
|
||||
id: bar1_left_rgb_front
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 0
|
||||
to: 0
|
||||
- platform: partition
|
||||
name: "BAR 1 Left RGB Back"
|
||||
id: bar1_left_rgb_back
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 1
|
||||
to: 1
|
||||
- platform: partition
|
||||
name: "BAR 1 Right RGB Front"
|
||||
id: bar1_right_rgb_front
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 2
|
||||
to: 2
|
||||
- platform: partition
|
||||
name: "BAR 1 Right RGB Back"
|
||||
id: bar1_right_rgb_back
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 3
|
||||
to: 3
|
||||
|
||||
output:
|
||||
#######################################
|
||||
### CS pins to control BAR Displays ###
|
||||
#######################################
|
||||
- id: cs_pin_bar1_left
|
||||
platform: gpio
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 5
|
||||
mode:
|
||||
output: true
|
||||
inverted: true
|
||||
- id: cs_pin_bar1_right
|
||||
platform: gpio
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 1
|
||||
mode:
|
||||
output: true
|
||||
inverted: true
|
||||
|
||||
display:
|
||||
####################
|
||||
### Main Display ###
|
||||
####################
|
||||
- id: main_display
|
||||
platform: ili9xxx
|
||||
model: ili9341
|
||||
invert_colors: false
|
||||
color_order: rgb
|
||||
update_interval: 30s
|
||||
dc_pin:
|
||||
number: GPIO37
|
||||
allow_other_uses: true
|
||||
cs_pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 5
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
show_test_card: false
|
||||
dimensions:
|
||||
height: 240
|
||||
width: 320
|
||||
rotation: 180
|
||||
##################
|
||||
### 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
|
||||
auto_clear_enabled: false
|
||||
dimensions:
|
||||
height: 160
|
||||
width: 80
|
||||
offset_width: 24
|
||||
@@ -1,68 +0,0 @@
|
||||
##############################################
|
||||
## ##
|
||||
## 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
|
||||
@@ -1,239 +0,0 @@
|
||||
############################################
|
||||
## ##
|
||||
## filename: 2bar_1display.yaml ##
|
||||
## description: Specific configuration ##
|
||||
## for the 2 BAR's, 1 Display setup ##
|
||||
## ##
|
||||
############################################
|
||||
|
||||
packages:
|
||||
base: !include base.yaml
|
||||
scripts: !include 2bar_1display_scripts.yaml
|
||||
|
||||
esphome:
|
||||
on_boot:
|
||||
priority: -100
|
||||
then:
|
||||
- script.execute: setup_bar_displays
|
||||
- script.execute: update_bar1_left
|
||||
- script.execute: update_bar1_right
|
||||
- script.execute: update_bar2_left
|
||||
- script.execute: update_bar2_right
|
||||
|
||||
mcp23008:
|
||||
- id: 'base_J1'
|
||||
i2c_id: buttons
|
||||
address: 0x21
|
||||
- id: 'base_J2'
|
||||
i2c_id: buttons
|
||||
address: 0x22
|
||||
- id: 'base_J3'
|
||||
i2c_id: buttons
|
||||
address: 0x23
|
||||
|
||||
binary_sensor:
|
||||
############################
|
||||
### Buttons Main Display ###
|
||||
############################
|
||||
- platform: gpio
|
||||
id: 'main_display_btn_left'
|
||||
name: "Main Display button Left"
|
||||
pin:
|
||||
mcp23xxx: base_J1
|
||||
number: 6
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
- platform: gpio
|
||||
id: 'main_display_btn_right'
|
||||
name: "Main Display button Right"
|
||||
pin:
|
||||
mcp23xxx: base_J1
|
||||
number: 2
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
|
||||
############################
|
||||
### Buttons BAR module 1 ###
|
||||
############################
|
||||
- platform: gpio
|
||||
id: 'bar1_btn_left'
|
||||
name: "BAR 1 button Left"
|
||||
pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 6
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
- platform: gpio
|
||||
id: 'bar1_btn_right'
|
||||
name: "BAR 1 button Right"
|
||||
pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 2
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
|
||||
############################
|
||||
### Buttons BAR module 2 ###
|
||||
############################
|
||||
- platform: gpio
|
||||
id: 'bar2_btn_left'
|
||||
name: "BAR 2 button Left"
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 6
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
- platform: gpio
|
||||
id: 'bar2_btn_right'
|
||||
name: "BAR 2 button Right"
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 2
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
|
||||
light:
|
||||
- id: !extend neopixels
|
||||
num_leds: 9
|
||||
##############################
|
||||
### RGB LED's BAR module 1 ###
|
||||
##############################
|
||||
- platform: partition
|
||||
name: "BAR 1 Left RGB Front"
|
||||
id: bar1_left_rgb_front
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 0
|
||||
to: 0
|
||||
- platform: partition
|
||||
name: "BAR 1 Left RGB Back"
|
||||
id: bar1_left_rgb_back
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 1
|
||||
to: 1
|
||||
- platform: partition
|
||||
name: "BAR 1 Right RGB Front"
|
||||
id: bar1_right_rgb_front
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 2
|
||||
to: 2
|
||||
- platform: partition
|
||||
name: "BAR 1 Right RGB Back"
|
||||
id: bar1_right_rgb_back
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 3
|
||||
to: 3
|
||||
##############################
|
||||
### RGB LED's BAR module 2 ###
|
||||
##############################
|
||||
- platform: partition
|
||||
name: "BAR 2 Left RGB Front"
|
||||
id: bar2_left_rgb_front
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 4
|
||||
to: 4
|
||||
- platform: partition
|
||||
name: "BAR 2 Left RGB Back"
|
||||
id: bar2_left_rgb_back
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 5
|
||||
to: 5
|
||||
- platform: partition
|
||||
name: "BAR 2 Right RGB Front"
|
||||
id: bar2_right_rgb_front
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 6
|
||||
to: 6
|
||||
- platform: partition
|
||||
name: "BAR 2 Right RGB Back"
|
||||
id: bar2_right_rgb_back
|
||||
segments:
|
||||
- id: neopixels
|
||||
from: 7
|
||||
to: 7
|
||||
|
||||
output:
|
||||
#######################################
|
||||
### CS pins to control BAR Displays ###
|
||||
#######################################
|
||||
- id: cs_pin_bar1_left
|
||||
platform: gpio
|
||||
pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 5
|
||||
mode:
|
||||
output: true
|
||||
inverted: true
|
||||
- id: cs_pin_bar1_right
|
||||
platform: gpio
|
||||
pin:
|
||||
mcp23xxx: base_J2
|
||||
number: 1
|
||||
mode:
|
||||
output: true
|
||||
inverted: true
|
||||
- id: cs_pin_bar2_left
|
||||
platform: gpio
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 5
|
||||
mode:
|
||||
output: true
|
||||
inverted: true
|
||||
- id: cs_pin_bar2_right
|
||||
platform: gpio
|
||||
pin:
|
||||
mcp23xxx: base_J3
|
||||
number: 1
|
||||
mode:
|
||||
output: true
|
||||
inverted: true
|
||||
|
||||
display:
|
||||
####################
|
||||
### Main Display ###
|
||||
####################
|
||||
- id: main_display
|
||||
platform: ili9xxx
|
||||
model: ili9341
|
||||
invert_colors: false
|
||||
color_order: rgb
|
||||
update_interval: 30s
|
||||
dc_pin:
|
||||
number: GPIO37
|
||||
allow_other_uses: true
|
||||
cs_pin:
|
||||
mcp23xxx: base_J1
|
||||
number: 5
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
show_test_card: false
|
||||
dimensions:
|
||||
height: 240
|
||||
width: 320
|
||||
rotation: 180
|
||||
###################
|
||||
### BAR modules ###
|
||||
###################
|
||||
- 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
|
||||
auto_clear_enabled: false
|
||||
dimensions:
|
||||
height: 160
|
||||
width: 80
|
||||
offset_width: 24
|
||||
@@ -1,114 +0,0 @@
|
||||
##############################################
|
||||
## ##
|
||||
## filename: 1bar_1display_scripts.yaml ##
|
||||
## description: Specific pre-defined ##
|
||||
## scripts for 2 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(cs_pin_bar2_left).turn_off();
|
||||
id(cs_pin_bar2_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(1);
|
||||
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(cs_pin_bar2_left).turn_off();
|
||||
id(cs_pin_bar2_right).turn_off();
|
||||
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(1);
|
||||
id(cs_pin_bar1_right).turn_off();
|
||||
- id: update_bar2_left
|
||||
then:
|
||||
- lambda: |-
|
||||
id(cs_pin_bar1_left).turn_off();
|
||||
id(cs_pin_bar1_right).turn_off();
|
||||
id(cs_pin_bar2_left).turn_on(); // <<
|
||||
id(cs_pin_bar2_right).turn_off();
|
||||
id(bar_display).clear();
|
||||
id(bar_display).set_rotation(display::DisplayRotation::DISPLAY_ROTATION_270_DEGREES);
|
||||
id(bar2_left_draw).execute();
|
||||
id(bar_display).update();
|
||||
delay(1);
|
||||
id(cs_pin_bar2_left).turn_off();
|
||||
- id: update_bar2_right
|
||||
then:
|
||||
- lambda: |-
|
||||
id(cs_pin_bar1_left).turn_off();
|
||||
id(cs_pin_bar1_right).turn_off();
|
||||
id(cs_pin_bar2_left).turn_off();
|
||||
id(cs_pin_bar2_right).turn_on(); // <<
|
||||
id(bar_display).clear();
|
||||
id(bar_display).set_rotation(display::DisplayRotation::DISPLAY_ROTATION_90_DEGREES);
|
||||
id(bar2_right_draw).execute();
|
||||
id(bar_display).update();
|
||||
delay(1);
|
||||
id(cs_pin_bar2_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();
|
||||
delay(5);
|
||||
id(cs_pin_bar2_left).turn_on();
|
||||
id(bar_display).setup();
|
||||
id(cs_pin_bar2_left).turn_off();
|
||||
delay(5);
|
||||
id(cs_pin_bar2_right).turn_on();
|
||||
id(bar_display).setup();
|
||||
id(cs_pin_bar2_right).turn_off();
|
||||
####################
|
||||
### draw scripts ###
|
||||
####################
|
||||
- id: bar1_left_draw
|
||||
then:
|
||||
- id: bar1_right_draw
|
||||
then:
|
||||
- id: bar2_left_draw
|
||||
then:
|
||||
- id: bar2_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
|
||||
- script.execute: update_bar2_left
|
||||
- delay: 0.1s
|
||||
- script.execute: update_bar2_right
|
||||
- delay: 0.1s
|
||||
+6
-3
@@ -13,7 +13,7 @@ esp32:
|
||||
interval:
|
||||
- interval: 1min
|
||||
then:
|
||||
- logger.log: "ESPHome for Button+ v0.1.1"
|
||||
- logger.log: "ESPHome for Button+ V2 v0.1.0"
|
||||
|
||||
i2c:
|
||||
- id: temperature_sensor
|
||||
@@ -25,8 +25,11 @@ i2c:
|
||||
frequency: 400khz
|
||||
|
||||
spi:
|
||||
clk_pin: GPIO36
|
||||
mosi_pin: GPIO35
|
||||
clk_pin: GPIO6
|
||||
mosi_pin: GPIO5
|
||||
|
||||
psram:
|
||||
mode: octal
|
||||
|
||||
globals:
|
||||
- id: nr_of_pages
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
music_card_enity_id: 'media_player.media_keuken_2'
|
||||
package:
|
||||
remote_package_files:
|
||||
url: https://github.com/dixi83/ESPHome_ButtonPlus
|
||||
url: https://gitea.furb.it/kennyboy55/ESPHome_ButtonPlusV2
|
||||
files: [<other files>,'package/cards/music.yaml']
|
||||
```
|
||||
* Add the music card to the main display `lambda` and give it the position you want
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
## music_card_enity_id: 'media_player.media_keuken_2'
|
||||
## package:
|
||||
## remote_package_files:
|
||||
## url: https://github.com/dixi83/ESPHome_ButtonPlus
|
||||
## url: https://gitea.furb.it/kennyboy55/ESPHome_ButtonPlusV2
|
||||
## files: [<other files>,'package/cards/music.yaml']
|
||||
##
|
||||
## display:
|
||||
|
||||
Reference in New Issue
Block a user