Exemplo n.º 1
0
/**
 * Read the battery voltage.
 *
 * @return The battery voltage in Volts.
 */
float DriverStation::GetBatteryVoltage() const {
  int32_t status = 0;
  float voltage = getVinVoltage(&status);
  wpi_setErrorWithContext(status, "getVinVoltage");

  return voltage;
}
Exemplo n.º 2
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getVinVoltage
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage
  (JNIEnv * env, jclass)
{
	int32_t status = 0;
	float val = getVinVoltage(&status);
  CheckStatus(env, status);
  return val;
}
Exemplo n.º 3
0
/**
 * Get the input voltage to the robot controller
 * @return The controller input voltage value in Volts
 */
double ControllerPower::GetInputVoltage() {
  int32_t status = 0;
  double retVal = getVinVoltage(&status);
  wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
  return retVal;
}
Exemplo n.º 4
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getVinVoltage
 * Signature: (Ljava/nio/IntBuffer;)F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage
  (JNIEnv * env, jclass, jobject status)
{
	jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
	return getVinVoltage(statusPtr);
}