public interface DeviceManager
| Modifier and Type | Interface and Description |
|---|---|
static class |
DeviceManager.DeviceType
Enum of Device Types
|
| Modifier and Type | Method and Description |
|---|---|
ColorSensor |
createAdafruitI2cColorSensor(DeviceInterfaceModule controller,
int channel)
Create an instance of a ColorSensor
|
AnalogInput |
createAnalogInputDevice(AnalogInputController controller,
int channel) |
OpticalDistanceSensor |
createAnalogOpticalDistanceSensor(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of an OpticalDistanceSensor
|
AnalogOutput |
createAnalogOutputDevice(AnalogOutputController controller,
int channel) |
DcMotor |
createDcMotor(DcMotorController controller,
int portNumber)
Create an instance of a DcMotor
|
DeviceInterfaceModule |
createDeviceInterfaceModule(SerialNumber serialNumber) |
DigitalChannel |
createDigitalChannelDevice(DigitalChannelController controller,
int channel) |
TouchSensor |
createDigitalTouchSensor(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of a TouchSensor
|
I2cDevice |
createI2cDevice(I2cController controller,
int channel) |
IrSeekerSensor |
createI2cIrSeekerSensorV3(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of a IrSeekerSensorV3
|
LED |
createLED(DigitalChannelController controller,
int channel)
Create an instance of an LED
|
ColorSensor |
createModernRoboticsI2cColorSensor(DeviceInterfaceModule controller,
int channel)
Create an instance of a ColorSensor
|
GyroSensor |
createModernRoboticsI2cGyroSensor(DeviceInterfaceModule deviceInterfaceModule,
int physicalPort)
Create an instance of a GyroSensor
|
AccelerationSensor |
createNxtAccelerationSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a AccelerationSensor
|
ColorSensor |
createNxtColorSensor(LegacyModule controller,
int channel)
Create an instance of a ColorSensor
|
CompassSensor |
createNxtCompassSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a NxtCompassSensor
|
DcMotorController |
createNxtDcMotorController(LegacyModule legacyModule,
int physicalPort)
Create an instance of an NXT DcMotorController
|
GyroSensor |
createNxtGyroSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a GyroSensor
|
IrSeekerSensor |
createNxtIrSeekerSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a IrSeekerSensor
|
LightSensor |
createNxtLightSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of a LightSensor
|
ServoController |
createNxtServoController(LegacyModule legacyModule,
int physicalPort)
Create an instance of an NXT ServoController
|
TouchSensor |
createNxtTouchSensor(LegacyModule legacyModule,
int physicalPort) |
TouchSensorMultiplexer |
createNxtTouchSensorMultiplexer(LegacyModule legacyModule,
int port) |
UltrasonicSensor |
createNxtUltrasonicSensor(LegacyModule legacyModule,
int physicalPort)
Create an instance of an UltrasonicSensor
|
PWMOutput |
createPwmOutputDevice(DeviceInterfaceModule controller,
int channel) |
Servo |
createServo(ServoController controller,
int portNumber)
Create an instance of a Servo
|
DcMotorController |
createUsbDcMotorController(SerialNumber serialNumber)
Create an instance of a DcMotorController
|
LegacyModule |
createUsbLegacyModule(SerialNumber serialNumber)
Create an instance of a LegacyModule
|
ServoController |
createUsbServoController(SerialNumber serialNumber)
Create an instance of a ServoController
|
java.util.Map<SerialNumber,DeviceManager.DeviceType> |
scanForUsbDevices()
Get a listing of all Modern Robotics devices connected.
|
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 deviceDcMotorController createUsbDcMotorController(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber - serial number of controllerRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionDcMotor createDcMotor(DcMotorController controller, int portNumber)
controller - DC Motor controller this motor is attached toportNumber - physical port number on the controllerServoController createUsbServoController(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber - serial number of controllerRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionServo createServo(ServoController controller, int portNumber)
controller - Servo controller this servo is attached toportNumber - physical port number on the controllerLegacyModule createUsbLegacyModule(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber - serial number of legacy moduleRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionDeviceInterfaceModule createDeviceInterfaceModule(SerialNumber serialNumber) throws RobotCoreException, java.lang.InterruptedException
serialNumber - serial number of Core Device Interface moduleRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionTouchSensor createNxtTouchSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - the Legacy Module this sensor is attached tophysicalPort - port number on Legacy Module it's connected toTouchSensorMultiplexer createNxtTouchSensorMultiplexer(LegacyModule legacyModule, int port)
legacyModule - the Legacy Module this sensor is attached toport - port number on Legacy Module this sensor is connected to.AnalogInput createAnalogInputDevice(AnalogInputController controller, int channel)
controller - Analog Input Controller Module this device is connected toAnalogOutput createAnalogOutputDevice(AnalogOutputController controller, int channel)
controller - Analog Output Controller Module this device is connected toDigitalChannel createDigitalChannelDevice(DigitalChannelController controller, int channel)
controller - Device Interface Module this device is connected toPWMOutput createPwmOutputDevice(DeviceInterfaceModule controller, int channel)
controller - PWM Output Controller Module this device is connected toI2cDevice createI2cDevice(I2cController controller, int channel)
controller - I2c Controller Module this device is conneced tochannel - the channel it's connected to on the ControllerDcMotorController createNxtDcMotorController(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toServoController createNxtServoController(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toCompassSensor createNxtCompassSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toTouchSensor createDigitalTouchSensor(DeviceInterfaceModule deviceInterfaceModule, int physicalPort)
deviceInterfaceModule - Legacy Module this device is connected tophysicalPort - port number on the Device Interface Module this device is connected toAccelerationSensor createNxtAccelerationSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toLightSensor createNxtLightSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toIrSeekerSensor createNxtIrSeekerSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toIrSeekerSensor 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 toUltrasonicSensor createNxtUltrasonicSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toGyroSensor createNxtGyroSensor(LegacyModule legacyModule, int physicalPort)
legacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toGyroSensor createModernRoboticsI2cGyroSensor(DeviceInterfaceModule deviceInterfaceModule, int physicalPort)
deviceInterfaceModule - module this device is connected tophysicalPort - port number on the Legacy Module this device is connected toOpticalDistanceSensor 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 intoColorSensor 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 toColorSensor createNxtColorSensor(LegacyModule controller, int channel)
controller - Legacy Module this sensor is attached tochannel - the I2C port it's connected toColorSensor createModernRoboticsI2cColorSensor(DeviceInterfaceModule controller, int channel)
controller - Device Interface Module this sensor is attached tochannel - the I2C port it's connected toLED createLED(DigitalChannelController controller, int channel)
controller - Digital Channel Controller this LED is connected tochannel - the digital port it's connected to