Releasing pot values in slow-mo

So let me clear that up a bit.
My pot outputs a read from 0 to 100.
For example let's say it reads 50 at the moment, but then I switch it to 75.

Now I don't want the code to know it now reads 75, rather tell it this second, that it reads 50, next second 51, next 52, untill it finally reaches 75.

But during all this time the code calculated something, every second, based on the value it had received.

So basically leave the rest of the code untouched, and have something that spits values every cycle, based on a pot.

You want someone to write that code for you?

Attache the code You use and please use code tags, up to the left in this window.

Idahowalker:
You want someone to write that code for you?

no no! i just want some pointers as to what it should use.
some ideas on how to make it work.

Railroader:
Attache the code You use and please use code tags, up to the left in this window.

.
.
.
int readPot;
float cTmpI;
  readPot=analogRead(potPin);
  readPot=analogRead(potPin);
  cTmpI = (50./1023.)*readPot;
  //cTmpI=5; //Pt testare si debuging
  Serial.print("Masura Potetiometru Temperatura: ");
  Serial.println(cTmpI);

.
.
.

if (tmpFinT>cTmpI&&cTmpI>tmpR)
    {
    dif=(int)((tmpFinT-cTmpI)*2);
    grdTSR+=dif;
    grdTSC-=dif;
    Serial.println(">>");
    }
if (tmpFinT<cTmpI&&cTmpI>tmpR)
    { 
    dif=(int)((cTmpI-tmpFinT)*2);
    grdTSR-=dif;
    grdTSC+=dif;
    Serial.println("<>");
    }
.
.
.

i used the "..." to indicate that there is also code there.

I'm thinking a couple of if-statements and a delay.

If the reading is higher than the displayed value, increment the displayed value by one, delay and loop.

If the reading is lower than the displayed value decrement by one, delay and loop.

Good but please attache the entire code. You can't imagine how often that is helpful for us.

Railroader:
Good but please attache the entire code. You can't imagine how often that is helpful for us.

#include <Servo.h>
#include <math.h>

//AREF voltage
#define aref_voltage 5  


Servo servo1;
Servo servo2;

int potPin=A1;

void setup() {
// Init Serial Monitor
  Serial.begin(9600);   
 

  servo1.attach(9);
  servo2.attach(10);
} 

void loop() {
float tmpR=5 //place holder for reading a temp sensor
float tmpC=10
float tmpFinT=(tmpR+tmpC)/2

int readPot;
float cTmpI;
  readPot=analogRead(potPin);
  readPot=analogRead(potPin);
  cTmpI = (50./1023.)*readPot;
  //cTmpI=5; // debuging
  Serial.print("pot read : ");
  Serial.println(cTmpI);

//--------------------------------------------


if (tmpFinT>cTmpI&&cTmpI>tmpR)
    {
    dif=(int)((tmpFinT-cTmpI)*2);
    grdTSR+=dif;
    grdTSC-=dif;
    Serial.println(">>");
    }
if (tmpFinT<cTmpI&&cTmpI>tmpR)
    {
    dif=(int)((cTmpI-tmpFinT)*2);
    grdTSR-=dif;
    grdTSC+=dif;
    Serial.println("<>");
    }

servo1.write(grdTSR);
servo2.write(grdTSC);

delay(1000);
}

there are also some parts i don't understand 100%, some friend helped me with them, but i don't want to be a nuisance to him

void loop() {
  float tmpR = 5 //place holder for reading a temp sensor
               float tmpC = 10
                            float tmpFinT = (tmpR + tmpC) / 2

                                int readPot;
  float cTmpI;

Read the second line and tell me why there is no semikolon after the "5"!
Autoformatting the code gives a strange picture..... Use that as often as You change anything!

Railroader:

void loop() {

float tmpR = 5 //place holder for reading a temp sensor
              float tmpC = 10
                            float tmpFinT = (tmpR + tmpC) / 2

int readPot;
  float cTmpI;




Read the second line and tell me why there is no semikolon after the "5"!
Autoformatting the code gives a strange picture..... Use that as often as You change anything!

oh yeah, there should be a ; there.
there still are some errors on there.

Yeh. Look att float tmpC = 10....

and   float tmpFinT = (tmpR + tmpC) / 2

Find and use the autoformat in the IDE! Click on "Tools", first line down......

Railroader:
and   float tmpFinT = (tmpR + tmpC) / 2

Find and use the autoformat in the IDE! Click on "Tools", first line down......

#include <Servo.h>
#include <math.h>

//AREF voltage
#define aref_voltage 5


Servo servo1;
Servo servo2;

int potPin = A1;

void setup() {
  // Init Serial Monitor
  Serial.begin(9600);


  servo1.attach(9);
  servo2.attach(10);
}

void loop() {
  float tmpR = 5; //place holder for reading a temp sensor
  float tmpC = 10;
  float tmpFinT = (tmpR + tmpC) / 2;

  int readPot;
  float cTmpI;
  readPot = analogRead(potPin);
  readPot = analogRead(potPin);
  cTmpI = (50. / 1023.) * readPot;
  //cTmpI=5; // debuging
  Serial.print("pot read : ");
  Serial.println(cTmpI);

  //--------------------------------------------


  float dif, grdTSR, grdTSC;
  if (tmpFinT > cTmpI && cTmpI > tmpR)
  {
    dif = (int)((tmpFinT - cTmpI) * 2);
    grdTSR += dif;
    grdTSC -= dif;
    Serial.println(">>");
  }
  if (tmpFinT < cTmpI && cTmpI > tmpR);
  {
    dif = (int)((cTmpI - tmpFinT) * 2);
    grdTSR -= dif;
    grdTSC += dif;
    Serial.println("<>");
  }

  servo1.write(grdTSR);
  servo2.write(grdTSC);

  delay(1000);
}

think i fixed it now

The missing semikolons really made Your code go off the tracks as I'm guessing.

I hope You have tested the autoformat. It paints out a map that looks terrible in situations like this.

Your last code attachement looks "geogriphicly" correct. Now the code will do what Your plans were.
Right or wrong, working or not? New games, new bets.

Railroader:
Your last code attachement looks "geogriphicly" correct. Now the code will do what Your plans were.
Right or wrong, working or not? New games, new bets.

yeah, still kind of stuck on how to do the values for the pot though.

Okey. What is the issue running this corrected code?
There are some tutorials written by @Robin2 telling how to use millis(), milliSeconds(), how to blink LEDs, and more.

Suppose You "read the clock", millis or micros, and save it when You perform a downstep. If You define a delaytime that has to expire before You make the next downstep, You can set the rate of change.