本帖最后由 dinglifeng 于 2021-12-20 17:23 编辑
老大 一个舵机的成功了 请问多个的怎么写?这样写没反应
# 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
|