Class PSPNXController

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SensorConstants, SensorMode, SensorModes, SampleProvider

    public class PSPNXController
    extends I2CSensor
    This class allows you to use a Sony Playstation 2 controller to control your robot in conjunction with the Mindsensors.com PSP-Nx interface. The controller has 2 analog joysticks and 16 buttons. See www.mindsensors.com
    • Constructor Detail

      • PSPNXController

        public PSPNXController​(I2CPort port)
      • PSPNXController

        public PSPNXController​(I2CPort port,
                               int address)
      • PSPNXController

        public PSPNXController​(Port port)
      • PSPNXController

        public PSPNXController​(Port port,
                               int address)
    • Method Detail

      • powerUp

        public void powerUp​(boolean activate)
      • getButtons

        public int[] getButtons()
        Each bit in the short byte represents the boolean (pressed or not pressed) of a button.
        Returns:
        Data for all 16 buttons as a int array
      • setDigitalMode

        public void setDigitalMode​(boolean activate)
      • getLeftX

        public int getLeftX()
      • getLeftY

        public int getLeftY()
      • getRightX

        public int getRightX()
      • getRightY

        public int getRightY()
      • getMode

        public byte getMode()
        Returns the current operating mode of the sensor. (put list of possible return values here:)
        Returns:
        -1 if error otherwise the operating mode
      • setADPAMode

        public void setADPAMode​(boolean activate)
        Use ADPA mode only if you are trying to connect more than one I2C sensor to a single port.
        Parameters:
        activate -