Package lejos.hardware.device
Class MSC
- java.lang.Object
-
- lejos.hardware.Device
-
- lejos.hardware.sensor.BaseSensor
-
- lejos.hardware.sensor.I2CSensor
-
- lejos.hardware.device.MSC
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SensorConstants,SensorMode,SensorModes,SampleProvider
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
Fields Modifier and Type Field Description static byteMSC8_VBATTstatic byteNXTSERVO_ADDRESSMServoservo1Servo at location 1MServoservo2Servo at location 2MServoservo3Servo at location 3MServoservo4Servo at location 4MServoservo5Servo at location 5MServoservo6Servo at location 6MServoservo7Servo at location 7MServoservo8Servo at location 8-
Fields inherited from class lejos.hardware.sensor.I2CSensor
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
-
Fields inherited from class lejos.hardware.sensor.BaseSensor
currentMode, modes
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, 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, WHITE, YELLOW
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBattery()Read the battery voltage data from NXTServo module (in millivolts)MServogetServo(int location)Method to get an RC Servo in from the NXTServo-
Methods inherited from class lejos.hardware.sensor.I2CSensor
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
-
Methods inherited from class lejos.hardware.sensor.BaseSensor
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
-
Methods inherited from class lejos.hardware.Device
close, releaseOnClose
-
-
-
-
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
-
-
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
-
-