Class BuiltInAccelerometer

    • Constructor Detail

      • BuiltInAccelerometer

        public BuiltInAccelerometer​(Accelerometer.Range range)
        Constructor.
        Parameters:
        range - The range the accelerometer will measure
      • BuiltInAccelerometer

        public BuiltInAccelerometer()
        Constructor. The accelerometer will measure +/-8 g-forces
    • Method Detail

      • setRange

        public void setRange​(Accelerometer.Range range)
        Description copied from interface: Accelerometer
        Common interface for setting the measuring range of an accelerometer.
        Specified by:
        setRange in interface Accelerometer
        Parameters:
        range - The maximum acceleration, positive or negative, that the accelerometer will measure. Not all accelerometers support all ranges.
      • getX

        public double getX()
        The acceleration in the X axis.
        Specified by:
        getX in interface Accelerometer
        Returns:
        The acceleration of the roboRIO along the X axis in g-forces
      • getY

        public double getY()
        The acceleration in the Y axis.
        Specified by:
        getY in interface Accelerometer
        Returns:
        The acceleration of the roboRIO along the Y axis in g-forces
      • getZ

        public double getZ()
        The acceleration in the Z axis.
        Specified by:
        getZ in interface Accelerometer
        Returns:
        The acceleration of the roboRIO along the Z axis in g-forces