Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to read the battery drain/charge rate of the GPD Pocket, outputs wattage. Negative is draining, positive is charging.
with open(dir + 'current_avg', 'r') as f:
current = int( / 1000000.0
with open(dir + 'voltage_avg', 'r') as f:
voltage = int( / 1000000.0
wattage = voltage * current
# print('{0:.2f}V {1:.2f}A {2:.2f}W'.format(voltage, current, wattage))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment