本文整理汇总了Java中com.qualcomm.robotcore.hardware.I2cDevice类的典型用法代码示例。如果您正苦于以下问题:Java I2cDevice类的具体用法?Java I2cDevice怎么用?Java I2cDevice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
I2cDevice类属于com.qualcomm.robotcore.hardware包,在下文中一共展示了I2cDevice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例9: OctupleLineSensor
import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public OctupleLineSensor(I2cDevice i2cDevice) {
this.i2cDevice = i2cDevice;
}
示例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);
}
示例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);
}
示例12: delegate
import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
@Override
protected abstract I2cDevice delegate();
示例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);
}
示例14: WireTAdafruitL3GD20H
import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public WireTAdafruitL3GD20H(@NotNull I2cDevice device) {
super(device, I2C_ADDRESS);
}
示例15: i2cControllerOfI2cDevice
import com.qualcomm.robotcore.hardware.I2cDevice; //导入依赖的package包/类
public static I2cController i2cControllerOfI2cDevice(I2cDevice i2cDevice) {
return Util.getPrivateObjectField(i2cDevice, 0);
}