-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRollerSpit.cpp
More file actions
37 lines (29 loc) · 805 Bytes
/
RollerSpit.cpp
File metadata and controls
37 lines (29 loc) · 805 Bytes
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
/** Command to move the rollers to spit out the rod for the given amount of time
* @author Hans Johnson
* @date Oct. 2015
**/
#include "RollerSpit.h"
/** Constructor
* @param duration Length of time in milliseconds to outtake for
**/
RollerSpit::RollerSpit(int duration) : PausableCommand("RollerSpit") {
_duration = duration;
curie = Robot::getInstance();
}
void RollerSpit::initialize() {}
void RollerSpit::execute() {
curie->roller->spit();
}
void RollerSpit::end() {
curie->roller->stop();
}
/** Command has finished when the amount of time has elapsed **/
bool RollerSpit::isFinished() {
return getTime() > _duration;
}
/** Stop the rollers when paused **/
void RollerSpit::onPause() {
curie->roller->stop();
}
/** Nothing special on resume **/
void RollerSpit::onResume() {}