com.dexterind.gopigo.components
Class Servo

java.lang.Object
  extended by com.dexterind.gopigo.components.Servo

public class Servo
extends java.lang.Object

It allows to move, enable or disable the servo motor.

Author:
marcello

Field Summary
private static Board board
          The main object which handles the methods to get access to the resources connected to the board.
private  Debug debug
          The debug object.
private static Servo instance
          The instance of the current object.
private  int position
          The current position value
 
Constructor Summary
Servo()
           
 
Method Summary
 int disable()
          Disables the servo motor.
 int enable()
          Enables the servo motor.
static Servo getInstance()
          Provides a global point of access to the Servo instance.
 int move(int position)
          Moves the servo motor to the position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

board

private static Board board
The main object which handles the methods to get access to the resources connected to the board.


instance

private static Servo instance
The instance of the current object.


position

private int position
The current position value


debug

private Debug debug
The debug object.

Constructor Detail

Servo

public Servo()
      throws java.io.IOException,
             java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException
Method Detail

getInstance

public static Servo getInstance()
                         throws java.io.IOException,
                                java.lang.InterruptedException
Provides a global point of access to the Servo instance.

Returns:
the Servo instance.
Throws:
java.io.IOException
java.lang.InterruptedException

move

public int move(int position)
         throws java.io.IOException
Moves the servo motor to the position.

Parameters:
position - The value of the rotation in degrees.
Returns:
A status code.
Throws:
java.io.IOException

enable

public int enable()
           throws java.io.IOException
Enables the servo motor.

Returns:
A status code.
Throws:
java.io.IOException

disable

public int disable()
            throws java.io.IOException
Disables the servo motor.

Returns:
A status code.
Throws:
java.io.IOException