Java VoltageSensor类代码示例(javavoltagesensor代码示例汇总)

本文整理汇总了Java中com.qualcomm.robotcore.hardware.VoltageSensor的典型用法代码示例。如果您正苦于以下问题:Java VoltageSensor类的具体用法?Java VoltageSensor怎么用?Java VoltageSensor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java VoltageSensor类代码示例(javavoltagesensor代码示例汇总)

VoltageSensor类属于com.qualcomm.robotcore.hardware包,在下文中一共展示了VoltageSensor类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getBatteryVoltage

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
double getBatteryVoltage() {
    double result = Double.POSITIVE_INFINITY;
    for (VoltageSensor sensor : hardwareMap.voltageSensor) {
        double voltage = sensor.getVoltage();
        if (voltage > 0) {
            result = Math.min(result, voltage);
        }
    }
    return result;
} 
开发者ID:ykarim,项目名称:FTC2016,代码行数:11,代码来源:ConceptTelemetry.java

示例2: getBatteryVoltage

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
double getBatteryVoltage() {
double result = Double.POSITIVE_INFINITY;
for (VoltageSensor sensor : hardwareMap.voltageSensor) {
    double voltage = sensor.getVoltage();
    if (voltage > 0) {
        result = Math.min(result, voltage);
        }
    }
return result;
} 
开发者ID:forgod01,项目名称:5094-2016-2017,代码行数:11,代码来源:ConceptTelemetry.java

示例3: createDeviceMaps

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的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

示例4: mapUsbMotorController

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
private void mapUsbMotorController(HardwareMap map, DeviceManager deviceMgr, ControllerConfiguration ctrlConf) throws RobotCoreException, InterruptedException {
    if (!ctrlConf.isEnabled()) return;
    ModernRoboticsUsbDcMotorController dcMotorController = (ModernRoboticsUsbDcMotorController) deviceMgr.createUsbDcMotorController(ctrlConf.getSerialNumber());
    map.dcMotorController.put(ctrlConf.getName(), dcMotorController);
    for (DeviceConfiguration devConf : ctrlConf.getDevices()) {
        mapMotor(map, deviceMgr, devConf, dcMotorController);
    }

    VoltageSensor voltageSensor = dcMotorController;
    map.voltageSensor.put(ctrlConf.getName(), voltageSensor);
} 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:12,代码来源:XtensibleEventLoop.java

示例5: mapNxtDcMotorController

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
private void mapNxtDcMotorController(HardwareMap map, DeviceManager deviceMgr, LegacyModule legacyModule, DeviceConfiguration ctrlConf) {
    if (!ctrlConf.isEnabled()) return;
    HiTechnicNxtDcMotorController dcMotorController = (HiTechnicNxtDcMotorController) deviceMgr.createNxtDcMotorController(legacyModule, ctrlConf.getPort());
    map.dcMotorController.put(ctrlConf.getName(), dcMotorController);
    for (DeviceConfiguration motorConf : ((MotorControllerConfiguration) ctrlConf).getMotors()) {
        mapMotor(map, deviceMgr, motorConf, dcMotorController);
    }

    VoltageSensor voltageSensor = dcMotorController;
    map.voltageSensor.put(ctrlConf.getName(), voltageSensor);
} 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:12,代码来源:XtensibleEventLoop.java

示例6: ExtensibleRobotVoltage

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
public ExtensibleRobotVoltage(@NotNull List<VoltageSensor> voltageSensors) {
    sensors = new LinkedList<>(checkNotNull(voltageSensors));
    numericalizer = new Numericalize<VoltageSensor>() {
        @Override
        public double toNumber(VoltageSensor object) {
            return object.getVoltage();
        }
    };
} 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:10,代码来源:ExtensibleRobotVoltage.java

示例7: close

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
@Override
public void close() {
    for (VoltageSensor sensor : sensors) {
        sensor.close();
    }

    sensors = null;
} 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:9,代码来源:ExtensibleRobotVoltage.java

示例8: addVoltageSensor

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
public void addVoltageSensor(@NotNull VoltageSensor sensor) {
    sensors.add(sensor);
} 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:4,代码来源:ExtensibleRobotVoltage.java

示例9: sensors

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
public List<VoltageSensor> sensors() {
    return ImmutableList.copyOf(sensors);
} 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:4,代码来源:ExtensibleRobotVoltage.java

示例10: voltageSensor

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
public VoltageSensor voltageSensor() {
    return this;
} 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:4,代码来源:HiTechnicDcMotorController.java

示例11: voltageSensors

import com.qualcomm.robotcore.hardware.VoltageSensor; //导入依赖的package包/类
/**
 * Returns a {@link DeviceMap<VoltageSensor>} for use to access VoltageSensor Sensor hardware
 *
 * @return a DeviceMap to use for access to representations of VoltageSensor Sensors
 * @see DeviceMap
 * @see VoltageSensor
 */
public DeviceMap<VoltageSensor> voltageSensors() {
    return fullMap.checkedGet(VoltageSensor.class);
} 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:11,代码来源:ExtensibleHardwareMap.java

本文标签属性:

示例:示例英语

代码:代码是什么

java:javascript18岁

VoltageSensor:VoltageSensor

上一篇:C++ FontPlatformData函数代码示例
下一篇:C++ NM_DEVICE_BT_GET_PRIVATE函数代码示例(c++get_private函数的15个代码示例)

为您推荐