• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java I2cDevice类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AdaFruitBNO055IMU

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
/**
 * Instantiate an AdaFruitBNO055IMU on the indicated device whose I2C address is the one
 * indicated.
 */
public AdaFruitBNO055IMU(OpMode context, I2cDevice i2cDevice, int i2cAddr8Bit) {
    this.context = context;

    // We don't have the device auto-close since *we* handle the shutdown logic
    this.deviceClient = ClassFactory.createI2cDeviceClient(context, ClassFactory.createI2cDevice(i2cDevice), i2cAddr8Bit, false);
    this.deviceClient.setReadWindow(lowerWindow);
    this.deviceClient.arm();

    this.parameters = null;
    this.currentMode = null;
    this.accelerationAlgorithm = new NaiveAccelerationIntegrator();
    this.accelerationMananger = null;

    RobotStateTransitionNotifier.register(context, this);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:20,代码来源:AdaFruitBNO055IMU.java


示例2: FtcI2cDeviceReader

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
/**
 * Constructor: Creates an instance of the object.
 *
 * @param instanceName specifies the instance name.
 * @param device specifies the I2C device this reader is created for.
 * @param i2cAddr specifies the I2C address of the device.
 * @param memStart specifies the start address of the register window to read from.
 * @param memLen specifies the length of the register window to read from.
 */
public FtcI2cDeviceReader(String instanceName, I2cDevice device, I2cAddr i2cAddr, int memStart, int memLen)
{
    super(device, i2cAddr, memStart, memLen);

    this.instanceName = instanceName;
    this.device = device;
    this.i2cAddr = i2cAddr;
    this.memStart = memStart;
    this.memLen = memLen;
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:20,代码来源:FtcI2cDeviceReader.java


示例3: SingleLineSensorArray

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
/**
 * @param i2cDevice  the i2c device from the hardwareMap
 * @param i2cAddr    the address of the i2c device
 * @param isInverted whether or not to invert all the sensor readings
 */
public SingleLineSensorArray(I2cDevice i2cDevice, I2cAddr i2cAddr, boolean isInverted) {
    this.i2cDevice = i2cDevice;
    this.i2cAddr = i2cAddr;
    this.isInverted = isInverted;

    //create an i2c reader to read the register we want
    i2cDeviceReader = new I2cDeviceReader(i2cDevice, i2cAddr, I2C_REG_DATA_A, 1);
}
 
开发者ID:FTC7393,项目名称:EVLib,代码行数:14,代码来源:SingleLineSensorArray.java


示例4: createDeviceMaps

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


示例5: Wire2

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public Wire2(@NotNull I2cDevice device, int deviceAddress) {
    this();
    this.wireDevice = device;
    wireDevAddress = (byte) deviceAddress;

    readCache = wireDevice.getI2cReadCache();
    writeCache = wireDevice.getI2cWriteCache();
    readLock = wireDevice.getI2cReadCacheLock();
    writeLock = wireDevice.getI2cWriteCacheLock();

    wireDevice.registerForI2cPortReadyCallback(this);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:13,代码来源:Wire2.java


示例6: Wire

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public Wire(@NotNull I2cDevice device, int deviceAddress) {
    this();
    this.wireDevice = device;
    wireDevAddress = (byte) deviceAddress;

    readCache = wireDevice.getI2cReadCache();
    writeCache = wireDevice.getI2cWriteCache();
    readLock = wireDevice.getI2cReadCacheLock();
    writeLock = wireDevice.getI2cWriteCacheLock();

    wireDevice.registerForI2cPortReadyCallback(this);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:13,代码来源:Wire.java


示例7: Wire2T

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public Wire2T(@NotNull I2cDevice device, int deviceAddress) {
    this();
    this.wireDevice = device;
    wireDevAddress = (byte) deviceAddress;

    readCache = wireDevice.getI2cReadCache();
    writeCache = wireDevice.getI2cWriteCache();
    readLock = wireDevice.getI2cReadCacheLock();
    writeLock = wireDevice.getI2cWriteCacheLock();

    wireDevice.registerForI2cPortReadyCallback(this);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:13,代码来源:Wire2T.java


示例8: create

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
/**
 * Instantiate an AdaFruitBNO055IMU and then initialize it with the indicated set of
 * parameters.
 */
public static IBNO055IMU create(OpMode context, I2cDevice i2cDevice, Parameters parameters) {
    // Create a sensor which is a client of i2cDevice
    IBNO055IMU result = new AdaFruitBNO055IMU(context, i2cDevice, parameters.i2cAddr8Bit.bVal);

    // Initialize it with the indicated parameters
    result.initialize(parameters);
    return result;
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:13,代码来源:AdaFruitBNO055IMU.java


示例9: OctupleLineSensor

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public OctupleLineSensor(I2cDevice i2cDevice) {
    this.i2cDevice = i2cDevice;
}
 
开发者ID:FTC7393,项目名称:EVLib,代码行数:4,代码来源:OctupleLineSensor.java


示例10: mapI2cDevice

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
private void mapI2cDevice(HardwareMap map, DeviceManager deviceMgr, I2cController i2cController, DeviceConfiguration devConf) {
    if (!devConf.isEnabled()) return;
    I2cDevice i2cDevice = deviceMgr.createI2cDevice(i2cController, devConf.getPort());
    map.i2cDevice.put(devConf.getName(), i2cDevice);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:6,代码来源:XtensibleEventLoop.java


示例11: mapI2cDeviceSynch

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
private void mapI2cDeviceSynch(HardwareMap map, DeviceManager deviceMgr, I2cController i2cController, DeviceConfiguration devConf) {
    if (!devConf.isEnabled()) return;
    I2cDevice i2cDevice = deviceMgr.createI2cDevice(i2cController, devConf.getPort());
    I2cDeviceSynch i2cDeviceSynch = new I2cDeviceSynchImpl(i2cDevice, true);
    map.i2cDeviceSynch.put(devConf.getName(), i2cDeviceSynch);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:7,代码来源:XtensibleEventLoop.java


示例12: delegate

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
@Override
protected abstract I2cDevice delegate();
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:3,代码来源:ForwardingI2cDevice.java


示例13: createWire

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
@Contract("_, _ -> !null")
public static Wire createWire(@NotNull I2cDevice device, byte address) {
    return new Wire(device, address);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:5,代码来源:I2cFactory.java


示例14: WireTAdafruitL3GD20H

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public WireTAdafruitL3GD20H(@NotNull I2cDevice device) {
    super(device, I2C_ADDRESS);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:4,代码来源:WireTAdafruitL3GD20H.java


示例15: i2cControllerOfI2cDevice

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public static I2cController i2cControllerOfI2cDevice(I2cDevice i2cDevice) {
    return Util.getPrivateObjectField(i2cDevice, 0);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:4,代码来源:MemberUtil.java


示例16: portOfI2cDevice

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public static int portOfI2cDevice(I2cDevice i2cDevice) {
    return Util.getPrivateIntField(i2cDevice, 1);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:4,代码来源:MemberUtil.java


示例17: ForwardedI2cDevice

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
private ForwardedI2cDevice(@NotNull I2cDevice device) {
    device = checkNotNull(device);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:4,代码来源:ExtensibleHardwareMap.java


示例18: delegate

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
@Override
protected I2cDevice delegate() {
    return device;
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:5,代码来源:ExtensibleHardwareMap.java


示例19: createWire

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public static Wire createWire(@NotNull I2cDevice device, byte address) {
    return new Wire(device, address);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:4,代码来源:I2cFactory.java


示例20: wire

import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
/**
 * Builds a new {@link Wire} to allow for a better usage of I2C Devices. This method only looks
 * at devices represented by {@link #i2cDevices()}
 *
 * @param name    the name of the I2C to use, as known by {@link #i2cDevices()}
 * @param address the respective I2C address for the I2C Device
 * @return a new Wire with the I2C Device represented by the given name
 * @throws NullPointerException if name is empty or null
 * @see Wire
 * @see I2cFactory
 * @see I2cDevice
 */
public Wire wire(String name, byte address) throws NullPointerException {
    checkNotNull(Strings.emptyToNull(name), "name is empty or null");
    I2cDevice i2cDevice = i2cDevices().get(name);
    if (i2cDevice == null) {
        throw new IllegalArgumentException("The device " + name + " is not found.");
    }
    return I2cFactory.createWire(i2cDevice, address);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:21,代码来源:ExtensibleHardwareMap.java



注:本文中的com.qualcomm.robotcore.hardware.I2cDevice类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SelectionButtonDialogFieldGroup类代码示例发布时间:2022-05-23
下一篇:
Java LongParser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap