import time
''' Simulated battery voltage (replace with actual code to read voltage)'''
def read_battery_voltage():
return 12.3 # Example value
# Simulated sending notification to phone
def send_notification(message):
print("Notification:", message)
# Main function
def main():
try:
while True:
# Read simulated battery voltage
battery_voltage = read_battery_voltage()
# Display performance data
print("Battery Voltage: {:.2f} V".format(battery_voltage))
# Send notification if battery voltage is low
if battery_voltage < 11.5: # Example threshold
send_notification("Battery voltage is low! {:.2f} V".format(battery_voltage))
# Sleep for 5 minutes before next reading
time.sleep(5) # Reduced sleep time for simulation purposes
except KeyboardInterrupt:
print("\nExiting...")
# Call the main function
if __name__ == "__main__":
main()