nl.tue.id.creapro.admoveo
Class Actuator

java.lang.Object
  extended by nl.tue.id.creapro.admoveo.Actuator
All Implemented Interfaces:
ActuatorControl
Direct Known Subclasses:
AnalogActuator, DigitalActuator

public abstract class Actuator
extends java.lang.Object
implements ActuatorControl

All digital and analog actuators extends this class. the control interface (ActuatorControl) is supposed to be implemented by all extending actuators.

Author:
jhu

Constructor Summary
Actuator(Arduino arduino, int pin)
          Creates an Actuator that is connected to a particular pin on the Arduino board.
 
Method Summary
static java.util.Vector getActuators()
          Gets all the available actuators.
 int getPin()
          Gets the pin to which this actuator is connected.
 boolean isOn()
           
 void off()
          Switches the actuator off.
 void on()
          Switches the actuator on.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Actuator

public Actuator(Arduino arduino,
                int pin)
Creates an Actuator that is connected to a particular pin on the Arduino board.

Parameters:
arduino - the Arduino board.
pin - the pin to which this actuator is connected.
Method Detail

getActuators

public static java.util.Vector getActuators()
Gets all the available actuators.

Returns:
the vector that contains all the available actuators.

getPin

public int getPin()
Gets the pin to which this actuator is connected.

Returns:
the pin (3, 5, 6, 9, 10, or 11).

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