Class CruizcoreGyro

    • Constructor Detail

      • CruizcoreGyro

        public CruizcoreGyro​(I2CPort port)
        Instantiates a new Cruizcore Gyro sensor.
        Parameters:
        port - the port the sensor is attached to
      • CruizcoreGyro

        public CruizcoreGyro​(Port port)
    • Method Detail

      • init

        protected void init()
      • setAccScale

        public void setAccScale​(int sf)
        Sets the acc scale.
        Parameters:
        sf - the scale factor: 0 for +/- 2G, 1 for +/- 4G, 2 for +/- 8g
        Throws:
        java.lang.IllegalArgumentException - if the parameter is neither 0, 1, or 2.
      • setAccScale2G

        public void setAccScale2G()
        Sets the acceleration scale factor to 2G.
      • setAccScale4G

        public void setAccScale4G()
        Sets the acceleration scale factor to 4G.
      • setAccScale8G

        public void setAccScale8G()
        Sets the acceleration scale factor to 8G.
      • reset

        public void reset()
        Resets the accumulated angle (heading).
      • getAccelerationMode

        public SensorMode getAccelerationMode()
        Cruizcore XG1300L, Acceleration mode
        Measures linear acceleration over three axes

        Size and content of the sample
        The sample contains 3 elements. Each element gives linear acceleration (in metres/second^2). Axis order in sample is X, Y, Z.

        Configuration
        The sensor can be configured for range using the setAccScale#G() methods of the sensor class.

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

        public SensorMode getRateMode()
        Cruizcore XG1300L, Acceleration mode
        Measures rate of turn over the Z-axis

        Size and content of the sample
        The sample contains one element, the rate of turn (in degrees / second) over the Z-axis.

        Configuration
        There are no configurable parameters.

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

        public SensorMode getAngleMode()
        Cruizcore XG1300L, Angle mode
        Measures angle over the Z-axis

        Size and content of the sample
        The sample contains one element, the accumulated angle (in degrees). .

        Configuration
        The accumulated angle can be reset to zero using the reset() method of the sensor class.

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