-
Notifications
You must be signed in to change notification settings - Fork 48
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
Open
purviyeshi
wants to merge
7
commits into
SRA-VJTI:humble
Choose a base branch
from
purviyeshi:Mario
base: humble
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8
−70
Open
Mario #79
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dc5844c
port set servo zero code into esp idf v5.1
purviyeshi fc0b703
reconstruct struct according to servo.h
purviyeshi 8290fa2
Reconstruct struct according to servo.h
purviyeshi 01039c1
Reconstruct struct according to servo.h
purviyeshi 6d9d1c6
Reconstruct struct according to servo.h
purviyeshi 52063db
add license
purviyeshi c4eab1c
add license
purviyeshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ 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 +31,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 | ||
// Initialising the OLED | ||
ESP_ERROR_CHECK(init_oled()); | ||
display_logo(MARIO_LOGO); | ||
vTaskDelay(100); | ||
#endif | ||
|
||
while (1) | ||
{ | ||
|
@@ -85,10 +74,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 | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
remove the indentations