SunSPOT API V3.0


com.sun.spot.sensorboard.peripheral
Interface IServo

All Known Implementing Classes:
Servo

public interface IServo

Reflect status of and allow control of an industry standard servo. what is a servo?

Author:
arshan

Method Summary
 IServoController getController()
          Return the servo controller for this servo.
 int getValue()
          return the current value of the pulse width
 void setBounds(int low, int high)
          specify the bounds that this servo can operate in
 void setPosition(float val)
          Set the relative position of this servo as a percentage of the position within the set bounds of this servo.
 void setValue(int val)
          Set the ouput pulse width for this servo.
 

Method Detail

setValue

void setValue(int val)
Set the ouput pulse width for this servo. Valid values are typically 1000-2000 usec. Once this value is set the ServoController for the servo is responsible for assuring that the pulse is sent with sufficient regularity to properly control the servo.

Parameters:
val - size of pulse in microseconds

getValue

int getValue()
return the current value of the pulse width

Returns:
size of current control pulse in microseconds

setPosition

void setPosition(float val)
Set the relative position of this servo as a percentage of the position within the set bounds of this servo.

Parameters:
val - value from 0.0 to 1.0

setBounds

void setBounds(int low,
               int high)
specify the bounds that this servo can operate in

Parameters:
low - the lower bound for the size of this servos pulse in microseconds
high - the upper bound for the size of this servos pulse in microseconds

getController

IServoController getController()
Return the servo controller for this servo. Intended to allow implementor to provide user with fine grain control of behaviour of the pulses generated for the servos, those controls would be reflected by the servoController

Returns:
the IServoController responsible for this servo IServoController

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.