Skip to content
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

read and manage battery voltage #498

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

cosmicpsyop
Copy link
Contributor

@cosmicpsyop cosmicpsyop commented Sep 22, 2024

Created and integrated a BatteryMonitor class formalizing what was used to test with T-HMI for general use.
1/ not really satisfied with the normalization of battery level based on voltage. charges to 100% unplug drops to 70%
2/ prototype temporary battery level on upper left for testing adding this to any screen layout.

#ifdef BATTERY_MONITOR_ENABLE
void printBatteryLevel()
{
  // Print Battery Level
  float batteryLevel = batteryMonitor.calculateBatteryLevel();

  // Convert float to string for rendering
  char batteryLevelStr[10];  // Adjust the size based on how many decimal places you need
  sprintf(batteryLevelStr, "%.0f", batteryLevel);  // Format float to string with 2 decimal places

  render.setFontSize(12);
  render.drawString(batteryLevelStr, 10/*210*/, 1,  TFT_WHITE/*0xDEDB*/);  // Use formatted string
}
#endif

3/ need help with background bmp graphics adjustments

xxx
See this video>> for how it works with lower screen and battery

#465

@cosmicpsyop cosmicpsyop marked this pull request as ready for review September 24, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant