A residual-quantity detecting method of the battery

The present invention discloses a battery remaining amount detecting method, comprising the steps of: S1: Initialization; S2: determining a current battery is in a charging state or discharging state, if the battery is in a charged state detection is performed, if the state of discharge of the discharge state battery detection; S3: set the sampling frequency dynamic returns to step S2. In the present invention, without increasing the hardware cost of the premise that the detection result of the battery power becomes very accurate, it solves the problem of charging the user apparatus can not accurately grasp the residual amount of the device, with the ability to auto-calibration error accumulated during use, can automatically adapt affecting battery aging and ambient temperature variations of the battery electrical storage capacity and discharging capacity, it is possible to automatically adjust the operating frequency, in order to accommodate the battery changing operation state, to achieve a variable frequency sampling, it can be widely used in smart phones, tablet computers, portable computer, charging electric vehicles and other equipment.