Battery CHecking Program

How do you write a program to check the battery life left? I want to add the code in my already existing program.
Topic archived. No new replies allowed.