-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStepper.cpp
69 lines (48 loc) · 1.02 KB
/
Stepper.cpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Stepper.cpp
*
* Created on: Nov 1, 2016
* Author: nem
*/
#include <basictypes.h>
#include <pins.h>
#include <predef.h>
#include <stdio.h>
#include <ctype.h>
#include <startnet.h>
#include "Stepper.h"
Stepper::Stepper() {
// TODO Auto-generated constructor stub
}
Stepper::~Stepper() {
// TODO Auto-generated destructor stub
}
void Stepper::Step(BYTE direction, WORD steps) {
Enable(); // motor should only be on when moving
// Insert Exercise 2 code here
Disable(); // once movement is over turn the motor off
}
void Stepper::Init(BYTE mode) {
// Insert Exercise 2 code here
}
void Stepper::Enable(void) {
// Insert Exercise 2 code here
}
void Stepper::Disable(void) {
// Insert Exercise 2 code here
}
void Stepper::SetDirection(BYTE dir) {
// Insert Exercise 2 code here
}
BYTE Stepper::GetDirection(void) {
return direction;
}
void Stepper::SetMode(BYTE mode){
// Insert Execise 2 code here
}
BYTE Stepper::GetMode(void) {
return motor_mode;
}
BYTE Stepper::GetState(void) {
return state;
}