pytest_stepper_motor.py 710 B

12345678910111213141516171819
  1. # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: CC0-1.0
  3. import pytest
  4. from pytest_embedded import Dut
  5. @pytest.mark.esp32s3
  6. @pytest.mark.esp32c6
  7. @pytest.mark.esp32h2
  8. @pytest.mark.generic
  9. def test_stepper_motor_example(dut: Dut) -> None:
  10. dut.expect_exact('example: Initialize EN + DIR GPIO')
  11. dut.expect_exact('example: Create RMT TX channel')
  12. dut.expect_exact('example: Set spin direction')
  13. dut.expect_exact('example: Enable step motor')
  14. dut.expect_exact('example: Create motor encoders')
  15. dut.expect_exact('example: Enable RMT channel')
  16. dut.expect_exact('example: Spin motor for 6000 steps: 500 accel + 5000 uniform + 500 decel')