-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmotors.c
50 lines (42 loc) · 1.05 KB
/
motors.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//------------------------------------------------------------------------------
//
// Description: This file contains the motor functionality
//
//
// Cameron Koegel
// Feb 2020
// Built with IAR Embedded Workbench Version: V7.12.4
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#include "functions.h"
#include "msp430.h"
#include "macros.h"
#include <string.h>
// Function Prototypes
void All_Wheels_Off(void);
void Drive_Fwd(void);
void Drive_Rev(void);
void CW_Spin(void);
void CCW_Spin(void);
void All_Wheels_Off(void) {
P6OUT &= ~R_FORWARD;
P6OUT &= ~L_FORWARD;
P6OUT &= ~R_REVERSE;
P6OUT &= ~L_REVERSE;
}
void Drive_Fwd(void) {
P6OUT |= R_FORWARD;
P6OUT |= L_FORWARD;
}
void Drive_Rev(void) {
P6OUT |= R_REVERSE;
P6OUT |= L_REVERSE;
}
void CW_Spin(void) {
P6OUT |= L_FORWARD;
P6OUT |= R_REVERSE;
}
void CCW_Spin(void) {
P6OUT |= R_FORWARD;
P6OUT |= L_REVERSE;
}