How to use Flex Sensor to Control number of turns of Servo?

Hello everyone, I wanna ask if how can I control the number of turns of a Servo using the flex sensor as a controller or input?

For example, if I have flex sensor varies from 25k-75k ohm and i wanna program this in this way.

if flexed the sensor to the max position and the servo must turn thrice or 3 turns and if a flexed to the half and the servo must give 1.5 turns, and if normal it will be back to the normal position which is zero degree.

Thank You,

Most servos only move through about 130-180 degrees. What servo are you using that will give you multiple turns?

Steve

the servo must turn thrice or 3 turns

"thrice" means three times.

Is this a winch servo?

Didn't know flex sensors can be twisted that much themselves.

Sounds more like a job for an encoder of sorts.

#include <Servo.h>


Servo Winch;


// servo.writeMicroseconds() constants for position of a 10-turn winch servo:
const int StartPosition = 1000;
const int TenTurns = 2000;
const int ThreeTurns = (((TenTurns - StartPosition) * 3) / 10) + StartPosition;


const byte WinchServoPin = 2;
const byte FlexSensorPin = A0;


const int FlexSensorMin = 0;  // DETERMINE BY EXPERIMENT
const int FlexSensorMax = 512;  // DETERMINE BY EXPERIMENT


void setup() {
  Winch.attach(WinchServoPin);
}


void loop() {
  Winch.writeMicroseconds(
    map(analogRead(FlexSensorPin), FlexSensorMin, FlexSensorMax, StartPosition, ThreeTurns));
}