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