Class FtcPixyCam1

java.lang.Object
trclib.archive.TrcPixyCam1
ftclib.archive.FtcPixyCam1

public class FtcPixyCam1 extends TrcPixyCam1
This class implements a platform dependent pixy camera 1 that is connected to an I2C bus. It provides access to the last detected objects reported by the pixy camera asynchronously.
  • Field Details

  • Constructor Details

    • FtcPixyCam1

      public FtcPixyCam1(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, int devAddress, boolean addressIs7Bit)
      Constructor: Create an instance of the object.
      Parameters:
      hardwareMap - specifies the global hardware map.
      instanceName - specifies the instance name.
      devAddress - specifies the I2C address of the device.
      addressIs7Bit - specifies true if the I2C address is a 7-bit address, false if it is 8-bit.
    • FtcPixyCam1

      public FtcPixyCam1(String instanceName, int devAddress, boolean addressIs7Bit)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      devAddress - specifies the I2C address of the device.
      addressIs7Bit - specifies true if the I2C address is a 7-bit address, false if it is 8-bit.
    • FtcPixyCam1

      public FtcPixyCam1(String instanceName)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
  • Method Details

    • isEnabled

      public boolean isEnabled()
      This method checks if the pixy camera is enabled.
      Returns:
      true if pixy camera is enabled, false otherwise.
    • setEnabled

      public void setEnabled(boolean enabled)
      This method enables/disables the pixy camera.
      Parameters:
      enabled - specifies true to enable pixy camera, false to disable.
    • asyncReadData

      public void asyncReadData(TrcPixyCam1.RequestId requestId, int length)
      This method issues an asynchronous read of the specified number of bytes from the device.
      Specified by:
      asyncReadData in class TrcPixyCam1
      Parameters:
      requestId - specifies the ID to identify the request. Can be null if none was provided.
      length - specifies the number of bytes to read.
    • asyncWriteData

      public void asyncWriteData(TrcPixyCam1.RequestId requestId, byte[] data)
      This method writes the data buffer to the device asynchronously.
      Specified by:
      asyncWriteData in class TrcPixyCam1
      Parameters:
      requestId - specifies the ID to identify the request. Can be null if none was provided.
      data - specifies the data buffer.