Skip to content
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

:add servo example #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

:add servo example #20

wants to merge 4 commits into from

Conversation

lurenw2
Copy link

@lurenw2 lurenw2 commented Jan 13, 2021

implemented a servo (MG996R) PWM motor base

@@ -0,0 +1,25 @@
#include "cmsis_os.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license

#define KEY_GPIO_GROUP GPIOB
#define KEY_GPIO_PIN GPIO_PIN_2

control::MotorPWMBase *motor1 = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
control::MotorPWMBase *motor1 = NULL;
control::MotorPWMBase *motor1 = nullptr;

Comment on lines 7 to 9
#define KEY_GPIO_GROUP GPIOB
#define KEY_GPIO_PIN GPIO_PIN_2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused stuff

#include "cmsis_os.h"
#include "main.h"

#include "bsp_print.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused header

control::MotorPWMBase *motor1 = NULL;

void RM_RTOS_Init() {
print_use_uart(&huart8);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this

examples/motor/servo.cc Show resolved Hide resolved
Copy link
Member

@alvinsunyixiao alvinsunyixiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. You need to format your code though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants