Class DutyCycleJNI
java.lang.Object
org.wpilib.hardware.hal.JNIWrapper
org.wpilib.hardware.hal.DutyCycleJNI
-
Nested Class Summary
Nested classes/interfaces inherited from class JNIWrapper
JNIWrapper.Helper -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfree(int handle) Free a DutyCycle.static doublegetFrequency(int handle) Get the frequency of the duty cycle signal.static intgetHighTime(int handle) Get the raw high time of the duty cycle signal.static doublegetOutput(int handle) Get the output ratio of the duty cycle signal.static intinitialize(int channel) Initialize a DutyCycle input.Methods inherited from class JNIWrapper
forceLoad, suppressUnused
-
Method Details
-
initialize
public static int initialize(int channel) Initialize a DutyCycle input.- Parameters:
channel- the smartio channel- Returns:
- the created duty cycle handle
- See Also:
-
free
public static void free(int handle) Free a DutyCycle.- Parameters:
handle- the duty cycle handle- See Also:
-
getFrequency
public static double getFrequency(int handle) Get the frequency of the duty cycle signal.- Parameters:
handle- the duty cycle handle- Returns:
- frequency in Hertz
- See Also:
-
getOutput
public static double getOutput(int handle) Get the output ratio of the duty cycle signal.0 means always low, 1 means always high.
- Parameters:
handle- the duty cycle handle- Returns:
- output ratio between 0 and 1
- See Also:
-
getHighTime
public static int getHighTime(int handle) Get the raw high time of the duty cycle signal.- Parameters:
handle- the duty cycle handle- Returns:
- high time of last pulse in nanoseconds
- See Also:
-