Class DexterGPSSensor

    • Constructor Detail

      • DexterGPSSensor

        public DexterGPSSensor​(I2CPort i2cPort)
        Constructor
        Parameters:
        i2cPort - the i2c port the sensor is connected to
      • DexterGPSSensor

        public DexterGPSSensor​(Port sensorPort)
        Constructor
        Parameters:
        sensorPort - the sensor port the sensor is connected to
    • Method Detail

      • init

        protected void init()
      • linkStatus

        public boolean linkStatus()
        Return status of link to the GPS satellites LED on dGPS should light if satellite lock acquired
        Returns:
        true if GPS link is up, else false
      • getPositionMode

        public SampleProvider getPositionMode()
        Dexter dGPS sensor, Position mode
        Gets the coordinates of the sensor

        Size and content of the sample
        The sample contains 2 elements. The first element is latitude, the second longitude.
        The sensor uses an integer-based representation of latitude and longitude values. Assume that you want to convert the value of 77 degrees, 2 minutes and 54.79 seconds to the integer-based representation. The integer value is computed as follows: R = 1000000 * (D + M / 60 + S / 3600) where D=77, M=2, and S=54.79. For the given values, the formula yields the integer value 77048553. Basically, this is equivalent to decimal degrees times a million.

        Returns:
        A sampleProvider See leJOS conventions for SampleProviders See Sensor datasheet
      • getAngleMode

        public SampleProvider getAngleMode()
        Dexter dGPS sensor, Angle mode
        Gets the heading of the sensor

        Size and content of the sample
        The sample contains one element representing the heading (in degrees) of the sensor. Accurate heading information can only be given when the sensor is in motion.

        Returns:
        A sampleProvider See leJOS conventions for SampleProviders See Sensor datasheet