Hello i am new to arduino , and i am trying to learn how to use it :
I am currently working on a project where i need to drive an outuput voltage of 12v to a heater, but i want to use a power supply .. that \ can manually change the values of the output
I also have in my mind an idea of using a rotary encoder or a potentiometer to change the output voltage in order to to change the heating .
But again also want to use a power supply to see how it works.
Do you have an idea of which power supply i can use
And please can you tell me if my point of using a rotary encoder or potentiometer would be accurate
As it is a heater, its physical state will not quickly change.
You could use a PWM output to control the heater.
For example, with
analogWrite (pinX, 128); // pinX = 3,5,6,9,10,11 on an Uno
then the 12V would be on 50% of the time, so the heater would run with the effect of the heater having 6V applied.
analogWrite (pinX, 64); // 25% on
analogWrite (pinX, 25); // 10% on
analogWrite (pinX, 192); 75% on
This is similar to how PWM is used to make LEDs appear dimmer or brighter.
Whqat you are looking for is commonly called a "programmable power supply" and by your description any power supply with 12 volts and maybe 10 amp capability which is adjustable output will serve your purpose. Google is your friend. Such power supplies have been around for decades. You know your requirements. You don't mention an interface? Programmable power supplies have different interfaces so what did you want?
If your idea here is to PWM the heater CrossRoads post #9 gives you a fine schematic. Your code example is incorrect. You call out analog pin 3. You read your pot on pin 3 and that gives you a value between 0 and 1023. You take that 0 to 1023 and map it to 0 to 255 or simply as suggested divide the analog input by 4. I have no idea what your analogWrite is about? You are writing 128 to pin 3.
Here is a code example.
const int pwm = 9 ;  //naming pin 3 as ‘pwm’ variable
const int adc = 0 ; //naming pin 0 of analog input side as ‘adc’
const int sensorValue = 0 ;
void setup()
{
  pinMode(pwm,OUTPUT) ; //setting pin 3 as output
}
void loop()
{
  int adc = analogRead(0) ;  //reading analog voltage and storing it in an integer
  adc = map(adc, 0, 1023, 0, 255); //map the analog input to 0 to 255 for PWM out.
Serial.println(sensorValue);
Serial.print(" ");Â
analogWrite(pwm,adc) ;
}
This is where it is also nice to have comments in your code explaining what the code is doing.
You can PWM a heater element but it is not normally done that way. Heating elements are slow responding. As written there is really no control.