抄各位老大的帖子 搞成了一个舵机接入esphome控制 ,自己尝试写多个舵机的,没成功,哪位高人给指点指点。
api service结尾带1的是自己加的,实际call service 舵机没有任何动作
# Enable Home Assistant API
api:
services:
- service: control_servo
variables:
level: float
level_reset: float
then:
- servo.write:
id: my_servo
level: !lambda 'return level / 100.0;'
- delay: 1s
- servo.write:
id: my_servo
level: !lambda 'return level_reset / 100.0;'
- service: control_servo1
variables:
level: float
level_reset: float
then:
- servo.write:
id: my_servo1
level: !lambda 'return level / 100.0;'
- delay: 1s
- servo.write:
id: my_servo1
level: !lambda 'return level_reset / 100.0;'
captive_portal:
servo:
- id: my_servo
output: pwm_output
- id: my_servo1
output: pwm_output1
output:
- platform: ledc
pin: GPIO18
id: pwm_output
frequency: 50 Hz
- platform: ledc
pin: GPIO19
id: pwm_output1
frequency: 50 Hz
|