File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
components/motor/servo/examples/servo_control/main Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
17#include <stdio.h>
28#include <math.h>
39#include "freertos/FreeRTOS.h"
@@ -15,14 +21,13 @@ static const char *TAG = "Servo Control";
1521static uint16_t calibration_value_0 = 30 ; // Real 0 degree angle
1622uint16_t calibration_value_180 = 195 ; // Real 0 degree angle
1723
18-
1924// Task to test the servo
2025static void servo_test_task (void * arg )
2126{
2227 ESP_LOGI (TAG , "Servo Test Task" );
2328 while (1 ) {
2429 // Set the angle of the servo
25- for (int i = calibration_value_0 ; i <= calibration_value_180 ; i += 1 ) {
30+ for (int i = calibration_value_0 ; i <= calibration_value_180 ; i += 1 ) {
2631 iot_servo_write_angle (LEDC_LOW_SPEED_MODE , 0 , i );
2732 vTaskDelay (20 / portTICK_PERIOD_MS );
2833 }
You can’t perform that action at this time.
0 commit comments