-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust voltage read percentage formula #4
Comments
Good idea! I'm also planning on averaging the battery voltage over the past 5 seconds or so because it's very jumpy right now. |
Can the icon fill by percent, and is voltage or percent shown next to the icon? |
Percentage is shown right now, and yeah I can try to get it to fill! |
Would voltage be more useful? That's how it is forthe FRC driverstation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you are currently using this code for getting a "percentage charged" value
int batteryCharge(int voltage) => (voltage / 255 * 100).round();
At about 8v, a current percentage value of 62%, or a voltage value of about 157 out of 255, URSA stops working because of the low voltage, and that should be displayed as 0% remaining. (A computer battery at" 0%" still has quite a bit of voltage)
In URSA's code, line
133
ofursa.ino
reads the voltage and scales it. You could change the scaling there so a 0 corresponds to right below the lowest functioning voltage if you would rather fix it in the robot code than here. Also, the voltage read in the robot still needs to be calibrated by adjustingDACUnitsPerVolt
; I found a rough value but it wasn't ever checked carefully.The text was updated successfully, but these errors were encountered: