Class RemoteNXTAnalogPort

    • Constructor Detail

      • RemoteNXTAnalogPort

        public RemoteNXTAnalogPort​(NXTCommand nxtCommand)
    • Method Detail

      • setTypeAndMode

        public boolean setTypeAndMode​(int type,
                                      int mode)
        Set the sensor type and mode
        Specified by:
        setTypeAndMode in interface BasicSensorPort
        Overrides:
        setTypeAndMode in class RemoteNXTIOPort
        Parameters:
        type - the sensor type
        mode - the sensor mode
        Returns:
        true if success
      • setType

        public boolean setType​(int type)
        Set the sensor type
        Specified by:
        setType in interface BasicSensorPort
        Overrides:
        setType in class RemoteNXTIOPort
        Parameters:
        type - the sensor type
        Returns:
        true if success
      • setMode

        public boolean setMode​(int mode)
        Set the sensor mode
        Specified by:
        setMode in interface BasicSensorPort
        Overrides:
        setMode in class RemoteNXTIOPort
        Parameters:
        mode - the sensor mode
        Returns:
        true if success
      • getPortType

        public static int getPortType​(int port)
        get the type of the port
        Parameters:
        port -
        Returns:
        true if sucesss
      • getAnalogSensorType

        public static int getAnalogSensorType​(int port)
        Get the type of analog sensor (if any) attached to the port
        Parameters:
        port -
        Returns:
        the type of analog sensor
      • getFloats

        public void getFloats​(float[] vals,
                              int offset,
                              int length)
        Description copied from interface: AnalogPort
        Return a series of results obtained from the sensor. This is currently only used for the NXT color sensor
        Specified by:
        getFloats in interface AnalogPort
        Parameters:
        vals - Place to store the values
        offset - Offset into the above array to start storing
        length - number of values to read
      • getPin6

        public float getPin6()
        Description copied from interface: AnalogPort
        return the voltage present on pin 6 of the sensor port
        Specified by:
        getPin6 in interface AnalogPort
        Returns:
        voltage reading
      • getPin1

        public float getPin1()
        Description copied from interface: AnalogPort
        return the voltage present on pin 1 of the sensor port
        Specified by:
        getPin1 in interface AnalogPort
        Returns:
        voltage reading