本帖最后由 dinglifeng 于 2021-12-20 17:24 编辑
请问一下楼主 我用esp32 nodemcu 接一个舵机成功了,怎么杨写才能接入多个舵机?
# 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
|