-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mario #79
base: humble
Are you sure you want to change the base?
Mario #79
Changes from 5 commits
dc5844c
fc0b703
8290fa2
01039c1
6d9d1c6
52063db
c4eab1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,3 @@ | ||
/* | ||
MIT License | ||
|
||
Copyright (c) 2024 Society of Robotics and Automation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
#include "sra_board.h" | ||
|
||
#define TAG "MCPWM_SERVO_CONTROL" | ||
|
@@ -30,50 +7,38 @@ servo_config servo_a = { | |
.min_pulse_width = CONFIG_SERVO_A_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_A_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_A_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_0, | ||
.gen = MCPWM_OPR_A, | ||
}; | ||
|
||
servo_config servo_b = { | ||
.servo_pin = SERVO_B, | ||
.min_pulse_width = CONFIG_SERVO_B_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_B_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_B_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_0, | ||
.gen = MCPWM_OPR_B, | ||
}; | ||
|
||
servo_config servo_c = { | ||
.servo_pin = SERVO_C, | ||
.min_pulse_width = CONFIG_SERVO_C_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_C_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_C_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_1, | ||
.gen = MCPWM_OPR_A, | ||
}; | ||
|
||
servo_config servo_d = { | ||
.servo_pin = SERVO_D, | ||
.min_pulse_width = CONFIG_SERVO_D_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_D_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_D_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_1, | ||
.gen = MCPWM_OPR_B, | ||
}; | ||
|
||
static void mcpwm_servo_control(void *arg) | ||
{ | ||
enable_servo(); | ||
#ifdef CONFIG_ENABLE_OLED | ||
// Initialising the OLED | ||
ESP_ERROR_CHECK(init_oled()); | ||
display_logo(MARIO_LOGO); | ||
vTaskDelay(100); | ||
#endif | ||
#ifdef CONFIG_ENABLE_OLED | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the indentations |
||
// Initialising the OLED | ||
ESP_ERROR_CHECK(init_oled()); | ||
display_logo(MARIO_LOGO); | ||
vTaskDelay(100); | ||
#endif | ||
|
||
while (1) | ||
{ | ||
|
@@ -85,10 +50,6 @@ static void mcpwm_servo_control(void *arg) | |
vTaskDelay(100); | ||
set_angle_servo(&servo_d, 0); | ||
vTaskDelay(100); | ||
#ifdef CONFIG_ENABLE_OLED | ||
// Diplaying Servo A, Servo B, Servo C, Servo D values on OLED | ||
display_servo_values(read_servo(&servo_a), read_servo(&servo_b), read_servo(&servo_c), read_servo(&servo_d)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this function removed? |
||
#endif | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,3 @@ | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't remove license |
||
MIT License | ||
|
||
Copyright (c) 2024 Society of Robotics and Automation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
#include "sra_board.h" | ||
|
||
#define TAG "MCPWM_SERVO_CONTROL" | ||
|
@@ -30,39 +7,27 @@ servo_config servo_a = { | |
.min_pulse_width = CONFIG_SERVO_A_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_A_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_A_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_0, | ||
.gen = MCPWM_OPR_A, | ||
}; | ||
|
||
servo_config servo_b = { | ||
.servo_pin = SERVO_B, | ||
.min_pulse_width = CONFIG_SERVO_B_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_B_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_B_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_0, | ||
.gen = MCPWM_OPR_B, | ||
}; | ||
|
||
servo_config servo_c = { | ||
.servo_pin = SERVO_C, | ||
.min_pulse_width = CONFIG_SERVO_C_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_C_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_C_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_1, | ||
.gen = MCPWM_OPR_A, | ||
}; | ||
|
||
servo_config servo_d = { | ||
.servo_pin = SERVO_D, | ||
.min_pulse_width = CONFIG_SERVO_D_MIN_PULSEWIDTH, | ||
.max_pulse_width = CONFIG_SERVO_D_MAX_PULSEWIDTH, | ||
.max_degree = CONFIG_SERVO_D_MAX_DEGREE, | ||
.mcpwm_num = MCPWM_UNIT_0, | ||
.timer_num = MCPWM_TIMER_1, | ||
.gen = MCPWM_OPR_B, | ||
}; | ||
|
||
#ifdef CONFIG_ENABLE_OLED | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove license