Class FtcPixyCam2

java.lang.Object
trclib.archive.TrcPixyCam2
ftclib.archive.FtcPixyCam2

public class FtcPixyCam2 extends TrcPixyCam2
This class implements a platform dependent pixy camera 2 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

    • FtcPixyCam2

      public FtcPixyCam2(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.
    • FtcPixyCam2

      public FtcPixyCam2(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.
    • FtcPixyCam2

      public FtcPixyCam2(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.
    • syncReadResponse

      public byte[] syncReadResponse()
      This method issues a synchronous read of the specified number of bytes from the device.
      Specified by:
      syncReadResponse in class TrcPixyCam2
    • syncWriteRequest

      public void syncWriteRequest(byte[] data)
      This method writes the data buffer to the device synchronously.
      Specified by:
      syncWriteRequest in class TrcPixyCam2
      Parameters:
      data - specifies the data buffer.