Added a charging check for the dead battery warning
Added battery warning code
Added battery warning code