Technically, your driving the motor with 12V half of the time which gives an average voltage of 6V. The phrase "heater of 6V" makes no sense. You can speak of half power, but not half voltage.I understand that from this code below , that i have already made the pin to work on 50% to produce a heater of 6v if the input is 12v
Connect the pot across the Arduino power supply and read the wiper position with an analog input. Use that value to control the duty cycle in line 4.but i don't understand how and where i should apply the potentiometer , to PWM the signal from the power source