nl.tue.id.creapro.admoveo
Class Motor

java.lang.Object
  extended by nl.tue.id.creapro.admoveo.Motor
All Implemented Interfaces:
ActuatorControl, AnalogActuatorControl

public class Motor
extends java.lang.Object
implements AnalogActuatorControl

This class models the motors on the AdMoVeo robot, providing the not only the control for analog actuators, but also some motor specific controls, such as forward() and backward();

Author:
jhu

Constructor Summary
Motor(Arduino arduino, int speedPin, int directionPin)
           
 
Method Summary
 void backward()
          Sets the motor to move backward.
 void forward()
          Set the motor to move forward.
 int getPower()
           
 boolean isForward()
           
 boolean isOn()
           
 void off()
          Switches the actuator off.
 void on()
          Switches the actuator on.
 void reverse()
           
 void setPower(int power)
          Sets the power level of the actuator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Motor

public Motor(Arduino arduino,
             int speedPin,
             int directionPin)
Method Detail

backward

public void backward()
Sets the motor to move backward.


forward

public void forward()
Set the motor to move forward.


getPower

public int getPower()

isForward

public boolean isForward()

isOn

public boolean isOn()
Specified by:
isOn in interface ActuatorControl

off

public void off()
Description copied from interface: ActuatorControl
Switches the actuator off.

Specified by:
off in interface ActuatorControl

on

public void on()
Description copied from interface: ActuatorControl
Switches the actuator on.

Specified by:
on in interface ActuatorControl

reverse

public void reverse()

setPower

public void setPower(int power)
Description copied from interface: AnalogActuatorControl
Sets the power level of the actuator.

Specified by:
setPower in interface AnalogActuatorControl
Parameters:
power - the power level, between 0 and 255.