jAER project on SourceForge

net.sf.jaer.hardwareinterface
Interface ServoInterface

All Superinterfaces:
HardwareInterface
All Known Implementing Classes:
SiLabsC8051F320_USBIO_CarServoController, SiLabsC8051F320_USBIO_ServoController, WowWeeAliveHardwareInterface, WowWeeRSHardwareInterface

public interface ServoInterface
extends HardwareInterface

A hardware interface that can set a set of servos implements this interface.

Author:
tobi

Method Summary
 void disableAllServos()
          disables all servos
 void disableServo(int servo)
          sends a servo value to disable the servo
 float getLastServoValue(int servo)
          Returns last servo value sent (0 before sending a value)
 float[] getLastServoValues()
          Returns last servo values sent.
 int getNumServos()
           
 void setAllServoValues(float[] values)
          sets all servos to values passed in array.
 void setPort2(int portValue)
          sends a command to set the port 2 output (on the side of the original board) to portValue.
 void setServoValue(int servo, float value)
          Sets a servo value.
 
Methods inherited from interface net.sf.jaer.hardwareinterface.HardwareInterface
close, getTypeName, isOpen, open
 

Method Detail

setServoValue

void setServoValue(int servo,
                   float value)
                   throws HardwareInterfaceException
Sets a servo value.

Parameters:
servo - the servo to set, 0 based.
value - the servo value, 0 to 1 value, value is clipped to 0,1 limits. 0 is most CW, 1 is most CCW when viewed looking down onto servo motor shaft, i.e. looking onto servo motor and not from behind it.
Throws:
HardwareInterfaceException
See Also:
setAllServoValues(float[])

disableServo

void disableServo(int servo)
                  throws HardwareInterfaceException
sends a servo value to disable the servo

Parameters:
servo - the servo number, 0 based
Throws:
HardwareInterfaceException

getNumServos

int getNumServos()
Returns:
number of servos supported by this interface

disableAllServos

void disableAllServos()
                      throws HardwareInterfaceException
disables all servos

Throws:
HardwareInterfaceException

setAllServoValues

void setAllServoValues(float[] values)
                       throws HardwareInterfaceException
sets all servos to values passed in array. This call sets all servo values in one method call and sends all values in a single interface transaction, reducing overhead and making changes synchronous.

Parameters:
values - array of values, 0-1 range. Values are clipped to 0-1 limits. 0 is most CW, 1 is most CCW when viewed looking down onto shaft of servo from in front of servo.
Throws:
HardwareInterfaceException
See Also:
getNumServos()

getLastServoValues

float[] getLastServoValues()
Returns last servo values sent.


getLastServoValue

float getLastServoValue(int servo)
Returns last servo value sent (0 before sending a value)


setPort2

void setPort2(int portValue)
sends a command to set the port 2 output (on the side of the original board) to portValue. This port is presently set to open-drain mode on all bits.

Parameters:
portValue - the bits to set

jAER project on SourceForge