Class AsyncADXRS450_Gyro

    • Constructor Detail

      • AsyncADXRS450_Gyro

        public AsyncADXRS450_Gyro()
        Default-construct an AsyncADXRS450_Gyro connected to the onboard SPI port
    • Method Detail

      • checkForUpdates

        public void checkForUpdates()
        Description copied from interface: Pollable
        Check for, and handle any updates since the last call. This should only be called from the Poller
        Specified by:
        checkForUpdates in interface Pollable
      • registerAngleCallback

        public void registerAngleCallback​(java.util.function.Consumer<java.lang.Double> callback)
        Register a callback for changes in gyro angle in degrees.
        Parameters:
        callback - Callback function
      • registerMotionCallback

        public void registerMotionCallback​(java.lang.Runnable callback,
                                           double motionThreshold)
        Register a callback for gyro motion. This is useful for detecting if a robot has been hit during aiming.
        Parameters:
        callback - Callback function
        motionThreshold - Threshold for motion in degrees
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class ADXRS450_Gyro