/Sensor.java Secret
Created
August 12, 2018 13:03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getBatteryColor() { | |
if (this.vbat > GOOD_BATTERY_VOLTAGE) { | |
return Color.parseColor(GREEN); | |
} | |
if (this.vbat > CRITICAL_BATTERY_VOLTAGE + VOLTAGE_BUFFOR) { | |
return Color.YELLOW; | |
} | |
return Color.RED; | |
} | |
public boolean batteryNeedRecharge() { | |
return this.vbat <= CRITICAL_BATTERY_VOLTAGE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment