lejos.nxt.addon
Class MSC

java.lang.Object
  extended by lejos.nxt.I2CSensor
      extended by lejos.nxt.addon.MSC
All Implemented Interfaces:
SensorConstants

public class MSC
extends I2CSensor

This class has been designed to manage the device MSC8, Mindsensors NXT Servo which manages up to 8 RC Servos. For example, do: msc.servo1.setAngle(angle) to set the angle of the servo at location 1. Many thanks to Luis Bunuel (bunuel66@hotmail.com) in Testing process

Author:
Juan Antonio Brenha Moral

Field Summary
static byte MSC8_VBATT
           
static byte NXTSERVO_ADDRESS
           
 MServo servo1
          Servo at location 1
 MServo servo2
          Servo at location 2
 MServo servo3
          Servo at location 3
 MServo servo4
          Servo at location 4
 MServo servo5
          Servo at location 5
 MServo servo6
          Servo at location 6
 MServo servo7
          Servo at location 7
 MServo servo8
          Servo at location 8
 
Fields inherited from class lejos.nxt.I2CSensor
PRODUCT_ID, SENSOR_TYPE, VERSION
 
Fields inherited from interface lejos.nxt.SensorConstants
MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE
 
Constructor Summary
MSC(SensorPort port)
          Constructor
 
Method Summary
 int getBattery()
          Read the battery voltage data from NXTServo module (in millivolts)
 MServo getServo(int location)
          Method to get an RC Servo in from the NXTServo
 
Methods inherited from class lejos.nxt.I2CSensor
fetchString, getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NXTSERVO_ADDRESS

public static final byte NXTSERVO_ADDRESS
See Also:
Constant Field Values

MSC8_VBATT

public static final byte MSC8_VBATT
See Also:
Constant Field Values

servo1

public MServo servo1
Servo at location 1


servo2

public MServo servo2
Servo at location 2


servo3

public MServo servo3
Servo at location 3


servo4

public MServo servo4
Servo at location 4


servo5

public MServo servo5
Servo at location 5


servo6

public MServo servo6
Servo at location 6


servo7

public MServo servo7
Servo at location 7


servo8

public MServo servo8
Servo at location 8

Constructor Detail

MSC

public MSC(SensorPort port)
Constructor

Parameters:
port - the NXTServo is connected to
Method Detail

getServo

public MServo getServo(int location)
Method to get an RC Servo in from the NXTServo

Parameters:
location - location of the servo (from 1 to 8)
Returns:
the MServo object

getBattery

public int getBattery()
Read the battery voltage data from NXTServo module (in millivolts)

Returns:
the battery voltage in millivolts