I am making heated socks with adjustments by Nano and want to extend batterty life?
With an electrical heating element powerful enough to warm your feet, the power to the heating element is hundreds or thousands of times greater than the power to your Arduino. Anything you do to reduce the power consumed by your Arduino will have no meaningful effect on your total power consumption. It's like trying to stop a drip in your faucet to save water while the main water pipe has water gushing out of a gaping hole.
Heating elements convert watts of power to calories of heat. The more watts you put in, the more heat you get.
Current • duty cycle • on-time = total power consumed AND total heat generated.
If you reduce the duty cycle to the heating element, you will reduce the power consumed, but you will also reduce the amount of heat generated.
Given that you already have the ability to vary the duty cycle to your heating element (via your analogWrite to right and left) the only meaningful way to reduce power consumption is to lower the heat setting. It looks like you already have that ability. Turn down the heat setting and have slightly colder feet, or use a higher capacity battery.
All that said, if you turn the heat setting down to 0, the heating element completely stops using power. At that point the Arudino will slowly drain your battery while your electric socks sit in your sock drawer. It would be worth putting your Arduino in ultra-low-power sleep mode (or even turning it off entirely) to avoid draining it while you're not using it.
Edit:
If you want to run the heating element on for 2 minutes, off for 2 minutes, that would give exactly the same power savings as running it at half the current power level, but constantly.
If you really want to implement the 2 minutes on, 2 minutes off approach, you will need to use millis() to keep track of the time when you last turned the elements on/off. I suggest refactoring your current code to remove delay and use millis as well.
Take a look at the &quot;BlinkWithoutDelay&quot; sketch (which I believe is included with the IDE, and is certainly available online) for an idea of how to handle timing things without using delay().