本文整理汇总了Java中com.qualcomm.robotcore.hardware.LED类的典型用法代码示例。如果您正苦于以下问题:Java LED类的具体用法?Java LED怎么用?Java LED使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LED类属于com.qualcomm.robotcore.hardware包,在下文中一共展示了LED类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildDevices
import com.qualcomm.robotcore.hardware.LED; //导入依赖的package包/类
private void buildDevices(List<DeviceConfiguration> list, HardwareMap map, DeviceManager deviceMgr, DeviceInterfaceModule deviceInterfaceModule) {
for (DeviceConfiguration deviceConfiguration : list) {
ConfigurationType devType = deviceConfiguration.getType();
if (devType == BuiltInConfigurationType.OPTICAL_DISTANCE_SENSOR) {
mapOpticalDistanceSensor(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.ANALOG_INPUT) {
mapAnalogInputDevice(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.TOUCH_SENSOR) {
mapTouchSensor(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.DIGITAL_DEVICE) {
mapDigitalDevice(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.PULSE_WIDTH_DEVICE) {
mapPwmOutputDevice(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.ANALOG_OUTPUT) {
mapAnalogOutputDevice(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.LED) {
mapLED(map, deviceMgr, deviceInterfaceModule, deviceConfiguration);
} else if (devType == BuiltInConfigurationType.NOTHING) {
// nothing to do
} else {
RobotLog.w("Unexpected device type connected to Device Interface Module while parsing XML: " + devType.toString());
}
}
}
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:25,代码来源:XtensibleEventLoop.java
示例2: createDeviceMaps
import com.qualcomm.robotcore.hardware.LED; //导入依赖的package包/类
/**
* Move the propriety {@link HardwareMap.DeviceMapping} to our {@link DeviceMap} for our
* internal use
*/
private void createDeviceMaps() {
fullMap.checkedPut(DcMotorController.class, new DeviceMap<>(basicMap.dcMotorController));
fullMap.checkedPut(DcMotor.class, new DeviceMap<>(basicMap.dcMotor));
fullMap.checkedPut(ServoController.class, new DeviceMap<>(basicMap.servoController));
fullMap.checkedPut(Servo.class, new DeviceMap<>(basicMap.servo));
fullMap.checkedPut(LegacyModule.class, new DeviceMap<>(basicMap.legacyModule));
fullMap.checkedPut(TouchSensorMultiplexer.class, new DeviceMap<>(basicMap.touchSensorMultiplexer));
fullMap.checkedPut(DeviceInterfaceModule.class, new DeviceMap<>(basicMap.deviceInterfaceModule));
fullMap.checkedPut(AnalogInput.class, new DeviceMap<>(basicMap.analogInput));
fullMap.checkedPut(DigitalChannel.class, new DeviceMap<>(basicMap.digitalChannel));
fullMap.checkedPut(OpticalDistanceSensor.class, new DeviceMap<>(basicMap.opticalDistanceSensor));
fullMap.checkedPut(TouchSensor.class, new DeviceMap<>(basicMap.touchSensor));
fullMap.checkedPut(PWMOutput.class, new DeviceMap<>(basicMap.pwmOutput));
fullMap.checkedPut(I2cDevice.class, new DeviceMap<>(basicMap.i2cDevice));
fullMap.checkedPut(AnalogOutput.class, new DeviceMap<>(basicMap.analogOutput));
fullMap.checkedPut(ColorSensor.class, new DeviceMap<>(basicMap.colorSensor));
fullMap.checkedPut(LED.class, new DeviceMap<>(basicMap.led));
fullMap.checkedPut(AccelerationSensor.class, new DeviceMap<>(basicMap.accelerationSensor));
fullMap.checkedPut(CompassSensor.class, new DeviceMap<>(basicMap.compassSensor));
fullMap.checkedPut(GyroSensor.class, new DeviceMap<>(basicMap.gyroSensor));
fullMap.checkedPut(IrSeekerSensor.class, new DeviceMap<>(basicMap.irSeekerSensor));
fullMap.checkedPut(LightSensor.class, new DeviceMap<>(basicMap.lightSensor));
fullMap.checkedPut(UltrasonicSensor.class, new DeviceMap<>(basicMap.ultrasonicSensor));
fullMap.checkedPut(VoltageSensor.class, new DeviceMap<>(basicMap.voltageSensor));
LinkedHashMultimap<DcMotorController, DcMotor> multimap = LinkedHashMultimap.create();
for (DcMotor motor : dcMotors()) {
multimap.put(motor.getController(), motor);
}
}
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:35,代码来源:ExtensibleHardwareMap.java
示例3: ColorSensor
import com.qualcomm.robotcore.hardware.LED; //导入依赖的package包/类
/**
* @param redLight the red LED
* @param blueLight the blue LED
* @param lightSensor the photoresistor
*/
public ColorSensor(LED redLight, LED blueLight, AveragedSensor lightSensor) {
this.redLight = redLight;
this.blueLight = blueLight;
this.lightSensor = lightSensor;
}
开发者ID:FTC7393,项目名称:EVLib,代码行数:11,代码来源:ColorSensor.java
示例4: mapLED
import com.qualcomm.robotcore.hardware.LED; //导入依赖的package包/类
private void mapLED(HardwareMap map, DeviceManager deviceMgr, DigitalChannelController digitalChannelController, DeviceConfiguration devConf) {
if (!devConf.isEnabled()) return;
LED led = deviceMgr.createLED(digitalChannelController, devConf.getPort());
map.led.put(devConf.getName(), led);
}
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:6,代码来源:XtensibleEventLoop.java
示例5: LEDs
import com.qualcomm.robotcore.hardware.LED; //导入依赖的package包/类
/**
* Returns a {@link DeviceMap<LED>} for use to access LED hardware
*
* @return a DeviceMap to use for access to representations of LEDs
* @see DeviceMap
* @see LED
*/
public DeviceMap<LED> LEDs() {
return fullMap.checkedGet(LED.class);
}
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:11,代码来源:ExtensibleHardwareMap.java
注:本文中的com.qualcomm.robotcore.hardware.LED类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论