mirror of
https://github.com/esphome/esphome.git
synced 2024-12-26 15:34:53 +01:00
06829b53fe
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
27 lines
602 B
YAML
27 lines
602 B
YAML
stepper:
|
|
- platform: a4988
|
|
id: test_stepper
|
|
step_pin: 3
|
|
dir_pin: 4
|
|
sleep_pin: 5
|
|
max_speed: 250 steps/s
|
|
acceleration: 100 steps/s^2
|
|
deceleration: 200 steps/s^2
|
|
|
|
switch:
|
|
- platform: template
|
|
name: Stepper Switch
|
|
assumed_state: true
|
|
turn_on_action:
|
|
- stepper.set_target:
|
|
id: test_stepper
|
|
target: !lambda |-
|
|
static int32_t i = 0;
|
|
i += 1000;
|
|
if (i > 5000) {
|
|
i = -5000;
|
|
}
|
|
return i;
|
|
- stepper.report_position:
|
|
id: test_stepper
|
|
position: 0
|