File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
src/main/java/org/darbots/corebotlib/hardware Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .darbots .corebotlib .hardware ;
2+
3+ import org .darbots .corebotlib .hardware .typedef .instances .ServoTypeInstance ;
4+
5+ public interface Servo {
6+ /**
7+ * Get last set position
8+ * @return Last set position in range of [-1,1]
9+ */
10+ double getTargetPosition ();
11+
12+ /**
13+ * Set a target position for servo
14+ * @param targetPosition target position in range [-1, 1]
15+ */
16+ void setTargetPosition (double targetPosition );
17+ ServoTypeInstance getServoType ();
18+ }
Original file line number Diff line number Diff line change 1+ package org .darbots .corebotlib .hardware ;
2+
3+ import org .darbots .corebotlib .hardware .typedef .instances .ServoTypeInstance ;
4+
5+ public class ServoUsingMotor implements Servo , AsyncDevice {
6+
7+ @ Override
8+ public double getTargetPosition () {
9+ return 0 ;
10+ }
11+
12+ @ Override
13+ public void setTargetPosition (double targetPosition ) {
14+
15+ }
16+
17+ @ Override
18+ public ServoTypeInstance getServoType () {
19+ return null ;
20+ }
21+
22+ @ Override
23+ public boolean isBusy () {
24+ return false ;
25+ }
26+
27+ @ Override
28+ public void update () {
29+
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments