How to make a coroutine decrement every 2 seconds?

I have been working on this script trying to make a script, in which every 2 seconds, the battery will decrease, causing the intensity, and range of the torch to drop. However what is happening, is it is waiting 2 seconds, then just ignoring the WaitForSeconds() and decrementing it every frame. How do I go about fixing this, and what exactly have I done wrong?

    // Torch light variable.
    public Light torchLight;
    // Counter for torch battery
    float torchBattery = 100.0f;
	// Use this for initialization
	void Start ()
    {
        StartCoroutine(batteryTimer());
	}

    IEnumerator batteryTimer()
    {
        while (torchBattery > 0.0f)
        {
            yield return new WaitForSeconds(2);
            torchBattery--;
        }
        do
        {
            yield return new WaitForSeconds(2);
            torchBattery++;
        }

        while (Input.GetKey("r"));
    }

The second loop is an endless loop and the wait for keypress is a bad idea in a Coroutine, because it will block (=freeze) the main loop.

But in principle it should work. I tested the following code and it worked:

  IEnumerator batteryTimer()
  {
    while (torchBattery > 0.0f)
    {
      yield return new WaitForSeconds(2);
      Debug.Log("battery: " + torchBattery );
      torchBattery--;
    }

    while (torchBattery < 100.0f)
    {
      yield return new WaitForSeconds(2);
      Debug.Log("battery: " + torchBattery );
      torchBattery++;
    }
  }