Source code for wpilib.utility

# validated: 2016-11-15 DV 7a402b4 athena/java/edu/wpi/first/wpilibj/Utility.java
#----------------------------------------------------------------------------
# Copyright (c) FIRST 2008-2016. All Rights Reserved.
# Open Source Software - may be modified and shared by FRC teams. The code
# must be accompanied by the FIRST BSD license file in the root directory of
# the project.
#----------------------------------------------------------------------------

import hal

__all__ = ["Utility"]

[docs]class Utility: """Contains global utility functions""" @staticmethod
[docs] def getFPGAVersion(): """Return the FPGA Version number. :returns: FPGA Version number. :rtype: int """ return hal.getFPGAVersion()
@staticmethod
[docs] def getFPGARevision(): """Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least significant bits are the Build Number. :returns: FPGA Revision number. :rtype: int """ return hal.getFPGARevision()
@staticmethod
[docs] def getFPGATime(): """Read the microsecond timer from the FPGA. :returns: The current time in microseconds according to the FPGA. :rtype: int """ return hal.getFPGATime()
@staticmethod
[docs] def getUserButton(): """Get the state of the "USER" button on the roboRIO. :returns: True if the button is currently pressed down :rtype: bool """ return hal.getFPGAButton()