My code always fails to run because the configuration option for I2C devices in the REV module is I2C Device(Synchronous), and there is no option for just I2C Device. In the SDK, I2CDeviceSynch is just a reading interface. This doesn't really make much sense to me. Has anyone gotten I2C to work with the FTC SDK 3.1?
Code:
Code:
Code:
public class PixyTest extends LinearOpMode { I2cDevice pixy; I2cDeviceSynch pixyReader; I2cAddr pixyAddress = I2cAddr.create7bit(0x54); byte[] readCache; @Override public void runOpMode() throws InterruptedException { pixy = hardwareMap.i2cDevice.get("pixy"); pixyReader = new I2cDeviceSynchImpl(pixy, pixyAddress, false); pixyReader.engage(); waitForStart(); while(opModeIsActive()) { readCache = pixyReader.read(0x54, 100); telemetry.addData("1", readCache[1]); telemetry.addData("2", readCache[2]); telemetry.addData("6", readCache[6]); telemetry.addData("7", readCache[7]); telemetry.addData("8", readCache[8]); telemetry.addData("9", readCache[9]); telemetry.addData("isInReadMode", pixy.isI2cPortInReadMode()); telemetry.update(); } } }