use of com.neuronrobotics.sdk.commands.neuronrobotics.dyio.PowerCommand in project java-bowler by NeuronRobotics.
the class DyIO method getBatteryVoltage.
/**
* THis method will return the current voltage on the battery connected to the DyIO external power connector.
* @param refresh true if you want to query the device, false to just get the cached value from the last async.
* @return the voltage of the battery in Volts
*/
public double getBatteryVoltage(boolean refresh) {
if (refresh) {
BowlerDatagram data = send(new PowerCommand());
powerEvent(data);
}
return batteryVoltage;
}
use of com.neuronrobotics.sdk.commands.neuronrobotics.dyio.PowerCommand in project java-bowler by NeuronRobotics.
the class DyIO method connect.
public boolean connect() {
if (getConnection() != null) {
getConnection().addConnectionEventListener(this);
getConnection().setSynchronusPacketTimeoutTime(3000);
}
if (super.connect()) {
getPid().setConnection(getConnection());
getPid().setAddress(getAddress());
getPid().connect();
send(new PowerCommand());
startHeartBeat(3000);
resync();
return true;
}
return false;
}
Aggregations