stepper overheating after first spin and stays on current to pin 2 3

I am using stepper with the simple ,stepper_oneRevolution example.
I follow all instructions for connecting 4 wires stepper.
The only thing that i changed is delay ,so can measure voltage to pins.

Before the first spin ,all the voltages to pins of the arduino is 0 and the voltage of stepper wires is 12 volt. In this stage stepper is spining freely by hand and there is no resistance to my hand.Also it doesn't heat at all

After the first spin ,voltages to arduino is 0 ,5 ,0 , 5 volts ,and the voltage to stepper is now 12, 0 ,12, 0 volt. In this stage stepper is heating even if I will not send a new spin.Also if I try to spin in with my hand I feel resistance from the stepper, like he is trying to hold position.

How can I ,after every spin ,set the pins on arduino back to 0 voltage state so I can reduse overheating? I dont want stepper to work as brake after every spin

Set the pins to being inputs perhaps?

Normally a stepper would be continuously powered like this to keep position between moves so that absolute position is kept.

Sometimes an application will reduce power when stationary to reduce heating as stationary (holding) torque is usually plenty. However stepper motors are not designed with efficiency in mind, just with feedbackless (open loop) motion control.

That is my idea also..I am thinking that I should turn all pins of arduino to LOW state, after every loop.
Das Anyone know the command of setting pins to LOW from the Stepper library ?
I tried motor_pin_1=0 motor_pin_2=0 ...etc but compiller sent error as unknown item

Don't think the library supports that, keeping position is the usual role of a stepper.

dalai:
That is my idea also..I am thinking that I should turn all pins of arduino to LOW state, after every loop.
Das Anyone know the command of setting pins to LOW from the Stepper library ?
I tried motor_pin_1=0 motor_pin_2=0 ...etc but compiller sent error as unknown item

what motor driver are you using by the way?

for those who still wonder : stepper.freeMotor();