继电器是5V, 低电平触发的4路继电器, 接驳了esp8266开发板的GPIO4, GPIO5, GPIO12, GPIO14, 安装在电风扇上使用, 每次关机后, 再打开电源, 继电器总会”嗒嗒”地响一下, 电风扇的风页会动一下才停下来了 请问是哪里出错了? 是缺少了部份代码, 还是引脚初始化时电平不穏定还是其他问题引起? 有方法可以解决吗?
代码:
esphome: name:esp8266
esp8266: board:nodemcuv2
logger:
api:
ota:
wifi: networks: -ssid: esp password: 12345678
captive_portal:
web_server: port: 80
switch: - platform: gpio name:"SpeedOne" pin: GPIO4 inverted:yes id: low interlock:[mid, fast]
- platform: gpio name:"Speedtwo" pin: GPIO5 inverted:yes id: mid interlock:[low, fast]
- platform: gpio name:"Speedthree" pin: GPIO12 inverted:yes id: fast interlock:[low, mid]
- platform: gpio name:"button4" pin: GPIO14 inverted:yes id: button
|