Le TM1638 avec ESPHome : un module pas cher multifonction

Un module sympa : le TM1638
Vidéo sur le TM1637 : • Afficheur 7 segments T...
Code Yaml :
web_server:
#NodeMCU = TM1638
#3V = VCC
#GND = GND
#D6 = STB
#D5 = CLK
#D4 = DIO
#TM1638 Display
display:
platform: tm1638
id: tm1638_display
stb_pin: D6
clk_pin: D5
dio_pin: D4
intensity: 5
update_interval: 5s
lambda: |-
it.print('01234567');
switch:
#LED D1
- platform: tm1638
id: TM1638Led1
name: TM1638Led1
led: 0
#LED D2
- platform: tm1638
id: TM1638Led2
name: TM1638Led2
led: 1
#LED D3
- platform: tm1638
id: TM1638Led3
name: TM1638Led3
led: 2
binary_sensor:
#SW1
- platform: tm1638
name: "TM1638 Button 1"
id: TM1638Button1
key: 0
filters:
- delayed_on: 10ms
on_press:
then:
- switch.turn_on: TM1638Led1
on_release:
then:
- switch.turn_off: TM1638Led1
#SW2
- platform: tm1638
name: "TM1638 Button 2"
id: TM1638Button2
key: 1
filters:
- delayed_on: 10ms
on_press:
then:
- switch.turn_on: TM1638Led2
on_release:
then:
- switch.turn_off: TM1638Led2
#SW4
- platform: tm1638
name: "TM1638 Button 4"
id: TM1638Button4
key: 3
filters:
- delayed_on: 10ms
on_press:
then:
- switch.turn_on: TM1638Led1
- switch.turn_on: TM1638Led2
on_release:
then:
- switch.turn_off: TM1638Led1
- switch.turn_off: TM1638Led2

0:00 Présentation
0:29 Branchements
0:49 Les afficheurs 7 segments
1:59 Les leds
3:00 Les boutons
4:02 Première automatisation
4:31 Conclusion

Пікірлер