How to correctly use map between a stepper motor controlled by a POT

Hi ive got a project that im working on which is going to be a pressure gauge using a car instrument cluster gauge stepper motor, and a pressure transducer.

My setup is;
NANO, Easy Stepper Driver, 10k POT (this will be replaced by pressure transducer), Stepper motor/Gauge.

I have wrote a sketch that works with the POT, it controls the full scale of the gauge over the full scale of the POT but when I add the pressure sensor the sensor and the gauge will need mapped together to match the scales of both the sensor and the gauge. But I just cant figure out the modifications required to the sketch to add the map function I realise that this is a basic mod to do but i just cant work it out.

Below ive added the sketch that works correctly with the POT.

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepMotor(AccelStepper::DRIVER, 5, 2);
// STEP PIN- 5
// DIR PIN- 2

// Tested with a 10k linear pot between 5v and GND
#define ANALOG_IN A0
void setup()
{
  //Serial.begin(115200);
    
  stepMotor.setMaxSpeed(100.0);
  stepMotor.setAcceleration(100.0);
  stepMotor.setSpeed(100.0);

  // Turn anticlockwise until hits the reference point
  stepMotor.runToNewPosition(-2000);

   long thisPosition = stepMotor.currentPosition();
   
  // Set the zero position
  stepMotor.setCurrentPosition(0);
  Serial.print(thisPosition);
  Serial.println(" Motor Position ");
  Serial.println("Stepper motor at reference point.");

  delay(1000);
  
}
void loop()
{
  // Read new position
  long thisPosition = stepMotor.currentPosition();
  int analog_in = analogRead(ANALOG_IN);
  stepMotor.moveTo(analog_in *1.4); //ratio of 1.4 to match the scale of the pot and gauge
  stepMotor.setMaxSpeed(4000.0);
  stepMotor.setAcceleration(4000.0);
  stepMotor.setSpeed(4000.0);
  stepMotor.runSpeedToPosition();
  Serial.print(thisPosition);
  Serial.println(" Motor Position ");
  Serial.print(analog_in);
  Serial.println(" Analog Value ");

}

Any help will be greatly appreciated.

Why have you started a new Thread about what seems to be the same project as in your other Thread which has all the background info?

Pleas click Report to Moderator and ask to have the Threads merged so we can easily see all the info in one place.

but when I add the pressure sensor the sensor and the gauge will need mapped together to match the scales of both the sensor and the gauge. But I just cant figure out the modifications required to the sketch to add the map function

Give us some examples of the input and the corresponding output that you want.

...R