public abstract class DeviceManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DeviceManager.DeviceType
Enum of Device Types
|
Constructor and Description |
---|
DeviceManager() |
Modifier and Type | Method and Description |
---|---|
abstract ColorSensor |
createAdafruitI2cColorSensor(DeviceInterfaceModule controller,
int channel)
Create an instance of a ColorSensor
|
abstract AnalogInput |
createAnalogInputDevice(AnalogInputController controller,
int channel) |
abstract OpticalDistanceSensor |
createAnalogOpticalDistanceSensor(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of an OpticalDistanceSensor
|
abstract AnalogOutput |
createAnalogOutputDevice(AnalogOutputController controller,
int channel) |
DcMotor |
createDcMotor(DcMotorController controller,
int portNumber)
Create an instance of a DcMotor
|
abstract DeviceInterfaceModule |
createDeviceInterfaceModule(SerialNumber serialNumber) |
abstract DigitalChannel |
createDigitalChannelDevice(DigitalChannelController controller,
int channel) |
abstract TouchSensor |
createDigitalTouchSensor(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of a TouchSensor
|
abstract I2cDevice |
createI2cDevice(I2cController controller,
int channel) |
abstract IrSeekerSensor |
createI2cIrSeekerSensorV3(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of a IrSeekerSensorV3
|
abstract LED |
createLED(DigitalChannelController controller,
int channel)
Create an instance of an LED
|
abstract ColorSensor |
createModernRoboticsI2cColorSensor(DeviceInterfaceModule controller,
int channel)
Create an instance of a ColorSensor
|
abstract GyroSensor |
createModernRoboticsI2cGyroSensor(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of a GyroSensor
|
abstract AccelerationSensor |
createNxtAccelerationSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a AccelerationSensor
|
abstract ColorSensor |
createNxtColorSensor(LegacyModule controller,
int channel)
Create an instance of a ColorSensor
|
abstract CompassSensor |
createNxtCompassSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a NxtCompassSensor
|
abstract DcMotorController |
createNxtDcMotorController(LegacyModule legacyModule,
int physicalPort)
Create an instance of an NXT DcMotorController
|
abstract GyroSensor |
createNxtGyroSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a GyroSensor
|
abstract IrSeekerSensor |
createNxtIrSeekerSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a IrSeekerSensor
|
abstract LightSensor |
createNxtLightSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a LightSensor
|
abstract ServoController |
createNxtServoController(LegacyModule legacyModule,
int physicalPort)
Create an instance of an NXT ServoController
|
abstract TouchSensor |
createNxtTouchSensor(LegacyModule legacyModule,
int physicalPort) |
abstract TouchSensorMultiplexer |
createNxtTouchSensorMultiplexer(LegacyModule legacyModule,
int port) |
abstract UltrasonicSensor |
createNxtUltrasonicSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of an UltrasonicSensor
|
abstract PWMOutput |
createPwmOutputDevice(DeviceInterfaceModule controller,
int channel) |
Servo |
createServo(ServoController controller,
int portNumber)
Create an instance of a Servo
|
abstract DcMotorController |
createUsbDcMotorController(SerialNumber serialNumber)
Create an instance of a DcMotorController
|
abstract LegacyModule |
createUsbLegacyModule(SerialNumber serialNumber)
Create an instance of a LegacyModule
|
abstract ServoController |
createUsbServoController(SerialNumber serialNumber)
Create an instance of a ServoController
|
abstract java.util.Map<SerialNumber,DeviceManager.DeviceType> |
scanForUsbDevices()
Get a listing of all Modern Robotics devices connected.
|
public abstract java.util.Map<SerialNumber,DeviceManager.DeviceType> scanForUsbDevices() throws RobotCoreException
This method will attempt to open all USB devices that are using an FTDI USB chipset. It will then probe the device to determine if it is a Modern Robotics device. Finally, it will close the device.
Because of the opening and closing of devices, it is recommended that this method is not called while any FTDI devices are in use.
RobotCoreException
- if unable to open a devicepublic abstract DcMotorController createUsbDcMotorController(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of controllerRobotCoreException
- if unable to create instancejava.lang.InterruptedException
public DcMotor createDcMotor(DcMotorController controller, int portNumber)
controller
- DC Motor controller this motor is attached toportNumber
- physical port number on the controllerpublic abstract ServoController createUsbServoController(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of controllerRobotCoreException
- if unable to create instancejava.lang.InterruptedException
public Servo createServo(ServoController controller, int portNumber)
controller
- Servo controller this servo is attached toportNumber
- physical port number on the controllerpublic abstract LegacyModule createUsbLegacyModule(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of legacy moduleRobotCoreException
- if unable to create instancejava.lang.InterruptedException
public abstract DeviceInterfaceModule createDeviceInterfaceModule(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of Core Device Interface moduleRobotCoreException
- if unable to create instancejava.lang.InterruptedException
public abstract TouchSensor createNxtTouchSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- the Legacy Module this sensor is attached tophysicalPort
- port number on Legacy Module it's connected topublic abstract TouchSensorMultiplexer createNxtTouchSensorMultiplexer(LegacyModule legacyModule, int port)
legacyModule
- the Legacy Module this sensor is attached toport
- port number on Legacy Module this sensor is connected to.public abstract AnalogInput createAnalogInputDevice(AnalogInputController controller, int channel)
controller
- Analog Input Controller Module this device is connected topublic abstract AnalogOutput createAnalogOutputDevice(AnalogOutputController controller, int channel)
controller
- Analog Output Controller Module this device is connected topublic abstract DigitalChannel createDigitalChannelDevice(DigitalChannelController controller, int channel)
controller
- Device Interface Module this device is connected topublic abstract PWMOutput createPwmOutputDevice(DeviceInterfaceModule controller, int channel)
controller
- PWM Output Controller Module this device is connected topublic abstract I2cDevice createI2cDevice(I2cController controller, int channel)
controller
- I2c Controller Module this device is conneced tochannel
- the channel it's connected to on the Controllerpublic abstract DcMotorController createNxtDcMotorController(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract ServoController createNxtServoController(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract CompassSensor createNxtCompassSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract TouchSensor createDigitalTouchSensor(DeviceInterfaceModule deviceInterfaceModule, int physicalPort)
deviceInterfaceModule
- Legacy Module this device is connected tophysicalPort
- port number on the Device Interface Module this device is connected topublic abstract AccelerationSensor createNxtAccelerationSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract LightSensor createNxtLightSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract IrSeekerSensor createNxtIrSeekerSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract IrSeekerSensor createI2cIrSeekerSensorV3(DeviceInterfaceModule deviceInterfaceModule, int physicalPort)
deviceInterfaceModule
- Device Interface Module this device is connected tophysicalPort
- port number on the Device Interface Module this device is connected topublic abstract UltrasonicSensor createNxtUltrasonicSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract GyroSensor createNxtGyroSensor(LegacyModule legacyModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract GyroSensor createModernRoboticsI2cGyroSensor(DeviceInterfaceModule deviceInterfaceModule, int physicalPort)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected topublic abstract OpticalDistanceSensor createAnalogOpticalDistanceSensor(DeviceInterfaceModule deviceInterfaceModule, int physicalPort)
deviceInterfaceModule
- Device Interface Module this sensor is connected tophysicalPort
- the port number on the Device Interface Module it's plugged intopublic abstract ColorSensor createAdafruitI2cColorSensor(DeviceInterfaceModule controller, int channel)
controller
- Device Interface Module this sensor is connected tochannel
- the I2C port on the Device Interface this module is connected topublic abstract ColorSensor createNxtColorSensor(LegacyModule controller, int channel)
controller
- Legacy Module this sensor is attached tochannel
- the I2C port it's connected topublic abstract ColorSensor createModernRoboticsI2cColorSensor(DeviceInterfaceModule controller, int channel)
controller
- Device Interface Module this sensor is attached tochannel
- the I2C port it's connected topublic abstract LED createLED(DigitalChannelController controller, int channel)
controller
- Digital Channel Controller this LED is connected tochannel
- the digital port it's connected to