assign VOLATILE V2
This commit is contained in:
30
ccs/motor.h
30
ccs/motor.h
@@ -2,18 +2,26 @@
|
||||
#define _motor_h_
|
||||
|
||||
#include "msp.h"
|
||||
#include "pwm.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define PERIOD_ms 20
|
||||
#define MAX_SPEED PERIOD_ms
|
||||
#define MOTOR_PERIOD 15000
|
||||
|
||||
void motor_init();
|
||||
void motor_move_stop();
|
||||
void motor_move_forward(int speed);
|
||||
void motor_move_backward(int speed);
|
||||
void motor_turn_left(int speed);
|
||||
void motor_turn_right(int speed);
|
||||
void motor_rotate_clockwise(int speed);
|
||||
void motor_rotate_cclockwise(int speed);
|
||||
void motor_move_custom(int left_speed, int right_speed);
|
||||
/**
|
||||
* @brief 모터 핀과 PWM 초기화
|
||||
* P2.6 P2.7 : PWM 출력
|
||||
* P5.4 P5.5 : 방향 제어
|
||||
* P3.6 P3.7 : 전원 공급
|
||||
*/
|
||||
void motor_init(void);
|
||||
|
||||
/**
|
||||
* @brief Set motor speeds.
|
||||
* @param left 왼쪽 모터 PWM
|
||||
* @param right 오른쪽 모터 PWM (-1000 ~ 1000)
|
||||
*/
|
||||
void motor_move(int32_t left, int32_t right);
|
||||
|
||||
void motor_stop(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user