Help a newbie

Hello, I recently started my first Arduino project, a lighting system for a radio control car.
I came across what should be a simple operation, however, I cannot find the proper way to do it, or even what doing it would be called to look it up.
I have calibration working, which populates SteerMin, SteerMax.

I would like to subtract 200 from SteerMax, and add 200 to SteerMin, to create SteerOnAbove and SteerOnBelow. I am using the SubFromSteer variable, as to only have to enter the value one time, and so later on I can use some form of manipulationto alter this value while in use.

These work and values are populated fine...
//Steer Cal
int SteerValue = 0; // the steer sensor value
int SteerMin = 1023; // minimum steer sensor value
int SteerMax = 0; // maximum steer sensor value
const int SubFromSteer = 200;

Having probelms with doing this...
int SteerOnBelow = (the value created by SteerMin + SubFromSteer)
int SteerOnAbove = (the value created by SteerMax - SubFromSteer)

Having probelms with doing this...

No real code + no real description of the problem == no real help.

A basic dead band setup.

void loop()
{
  int value = analogRead(sensePin);

  if (value > 400 || value < 300)
      Serial.println(value); 
  delay(500);   //wait half a second, then check again.
}

Here is my entire code, as it is currently written.
This is a controller for lighting on a remote control car.
What is supposed to happen, is that the user turns the wheel on the remote to both extremes during setup.
The coding should permit both a central deadband, where neither turn signal is active, along with high/low values set during cal, and trigger points which are just under max/min values.
The cal process, will be turning the steering wheel. As an example: Right turn "Max" reads at 3000, Left turn "Min" reads at 2000, so the max and min get set as such during cal procedure.
The Steer on Above/Below variables, will cause the light blinking condition to occur before max/min value is met.
The issue with the standard deadband setup, is that there are quite a few times when the steering channel max/min values are changed, trimming for straight driving, limiting servo throw, etc.
The neutral position, is also altered, so I would appreciate, if there was a way to assign the neutral position, based on the current neutral position, and when the steering wheel is moved a certain amount in either direction, the left or right led blinking program is activated.

// constants won't change. Used here to 
// set pin numbers:
const int led = 13; //Internal LED
const int steer_read = 2; //Steering read
const int throt_read = 3; //Throttle read
const int aux_read = 4; //Aux Channel read
const int left_ts = 5; //Left turn signal
const int right_ts = 6; //Right turn signal
const int break_lt = 7; //Brake Light
const int backup_lt = 8; //Backup Light
// Variables will change:
int ledState_leftts = LOW;             // ledState used to set the left ts
int ledState_rightts = LOW;             // ledState used to set the right ts
long previousMillis = 0;        // will store last time LED was updated
//CalibrationVariables
//Steer Cal
int SteerValue = 0;         // the steer sensor value
int SteerMin = 1023;        // minimum steer sensor value
int SteerMax = 0;           // maximum steer sensor value
const int SubFromSteer = 200; //Create deadband where wheel is not at max/min, but max/min trigger is activated.
int SteerOnBelow = (SteerMin + 200);   //////////////////////////////////////////////////////////////ISSUES WITH THESE LINES
int SteerOnAbove = (SteerMax - 200); /////////////////////////////////////////////////////////////////////////////////////


// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval_for_flashers = 667;           // interval_for_flashers at which to blink (milliseconds)

void setup()
 {
 pinMode(led, OUTPUT);
 pinMode(steer_read, INPUT); //Steering read
 pinMode(throt_read, INPUT); //Throttle read
 pinMode(aux_read,INPUT); //Aux 3 read
 pinMode(left_ts,OUTPUT);//Left Turn Signal
 pinMode(right_ts,OUTPUT);//Right Turn Signal
// pinMode (break_lt, OUTPUT);//Brake light
 //pinMode (backup_lt, OUTPUT);//Backup light
//CALIBRATION ROUTINE
  // turn on LED to signal the start of the calibration period:
   digitalWrite(led, HIGH);
  // calibrate during the first five seconds
   while (millis() < 5000) {
//assign inputs to read
     int SteerValue = pulseIn(steer_read, HIGH);
     //int ThrotValue = pulseIn(throt_read, HIGH);
     //int AuxValue = pulseIn(aux_read, HIGH);
  // record the maximum steer sensor value
   if (SteerValue > SteerMax) {SteerMax = SteerValue;}
  // record the minimum steer sensor value
   if (SteerValue < SteerMin) { SteerMin = SteerValue;}
//Calibrate Throt
  // record the maximum throt sensor value
     //   if (ThrotValue > ThrotMax) { ThrotMax = ThrotValue;}
  // record the minimum throt sensor value
     //   if (ThrotValue < ThotMin) { ThrotMin = ThrotValue;}
//Calibrate Aux
  // record the maximum aux sensor value
     //   if (AuxValue > AuxMax) { AuxMax = AuxValue;}
  // record the minimum throt sensor value
     //   if (AuxValue < AuxMin) { AuxMin = AuxValue;}
   // signal the end of the calibration period
   digitalWrite(13, LOW);
}
}
 void loop() {
int strduration = pulseIn(steer_read, HIGH);
if (strduration <= SteerOnBelow || strduration >= SteerOnAbove){
  if (strduration <= SteerOnBelow){
    //Turn Left
    unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval_for_flashers) {
     // save the last time you blinked the LED 
     previousMillis = currentMillis;   

     // if the LED is off turn it on
     if (ledState_leftts == LOW)
       ledState_leftts = HIGH;
     else
       ledState_leftts = LOW;

     // set the LED to the variable:
     digitalWrite(led, ledState_leftts);
     digitalWrite(left_ts, ledState_leftts);
     }
 }//close if below
if (strduration >= SteerOnAbove){
  //Turn Right
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval_for_flashers) {
     // save the last time you blinked the LED 
     previousMillis = currentMillis;   

     // if the LED is off turn it on and vice-versa:
     if (ledState_rightts == LOW)
       ledState_rightts = HIGH;
     else
       ledState_rightts = LOW;

     // set the LED with the ledState of the variable:
     digitalWrite(led, ledState_rightts);
     digitalWrite(right_ts, ledState_rightts);
   }
}
//close if > above
}
else {
  digitalWrite (left_ts, LOW);
  digitalWrite (right_ts, LOW);
  digitalWrite (led, LOW);
}
//close the loop
}

Also, sorry about not providing code.

int SteerOnBelow = (SteerMin + 200);//ISSUES WITH THESE LINES
int SteerOnAbove = (SteerMax - 200);

You still don't intend to explain what those issues are? Well, good luck.

The issue, as I thought I said in my first post, is that I do not know how to code what I want done, or what to even call it. beyond what I said. Add/Subtract 200 from the min/max values.

I would like for a max reading of 3000 to be changed to 2800 by subtracting 200 or a min reading of 1000 to become 1200 and those new values set as new variables.

The commented lines, are just so anyone willing to help, can find the code section faster than reading all of the code. Sort of a modification needed here marker.

I do not even know how to explain the issue any further, other than to state what I want to do, and that I do not know how to program for it.

Maybe it is wrong calling it an issue??? It is more of a lack of needed knowledge, and the inability to know enough to even be able to search for the answer I need.

"You still don't intend to explain what those issues are? Well, good luck."

I explained my coding problem three times now. I do not know "how" / "what the proper code is" and explained what I want to do.
All I ask for, is someone to tell me how to subtract a value from a variable, and create a new variable with that new value.

I would like for a max reading of 3000 to be changed to 2800 by subtracting 200 or a min reading of 1000 to become 1200 and those new values set as new variables.

The implication here is that this is not happening. I see no proof that it isn't.

The only problem is can see is that you seem to think that those two lines of code bind the values of SteerOnBelow and SteerOnAbove to SteerMin and SteerMax. They do not. They do a one valuation based on the values in SteerMax and SteerMin, which haven't been updated yet.

Declared the variables where you have that code, and move the valuation after the point where SteerMin and SteerMax are valued.

Thank you for being willing to work with me.

Are you saying, that I need to do the addition/subtraction stuff inside the loop section, instead of at the top of the code?

As I said, I am just getting started. I know, I have a lot to learn.

Are you saying, that I need to do the addition/subtraction stuff inside the loop section, instead of at the top of the code?

The calibration, where SteerMin and SteerMax are valued happens in setup(), so SteerOnBelow and SteerOnAbove should be valued there, too.

Thank you so much!
That got it working properly.

Really appreciate the assistance.

New code...

// constants won't change. Used here to 
// set pin numbers:
const int led = 13; //Internal LED
const int steer_read = 2; //Steering read
const int throt_read = 3; //Throttle read
const int aux_read = 4; //Aux Channel read
const int left_ts = 5; //Left turn signal
const int right_ts = 6; //Right turn signal
const int break_lt = 7; //Brake Light
const int backup_lt = 8; //Backup Light
// Variables will change:
int ledState_leftts = LOW;             // ledState used to set the left ts
int ledState_rightts = LOW;             // ledState used to set the right ts
long previousMillis = 0;        // will store last time LED was updated
//CalibrationVariables
//Steer Cal
int SteerValue = 0;         // the steer sensor value
int SteerMin = 10000;        // minimum steer sensor value
int SteerMax = 0;           // maximum steer sensor value
int SteerOnBelow = 0;
int SteerOnAbove = 0;


// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval_for_flashers = 667;           // interval_for_flashers at which to blink (milliseconds)

void setup()
 {
 Serial.begin(9600);
 Serial.println("Hello world!");  
 pinMode(led, OUTPUT);
 pinMode(steer_read, INPUT); //Steering read
 pinMode(throt_read, INPUT); //Throttle read
 pinMode(aux_read,INPUT); //Aux 3 read
 pinMode(left_ts,OUTPUT);//Left Turn Signal
 pinMode(right_ts,OUTPUT);//Right Turn Signal
 pinMode (break_lt, OUTPUT);//Brake light
 pinMode (backup_lt, OUTPUT);//Backup light
//CALIBRATION ROUTINE
  // turn on LED to signal the start of the calibration period:
   digitalWrite(led, HIGH);
  // calibrate during the first five seconds
   while (millis() < 5000) {
//assign inputs to read
     int SteerValue = pulseIn(steer_read, HIGH);
     // record the maximum steer sensor value
   if (SteerValue > SteerMax) {SteerMax = SteerValue;}
    SteerOnAbove = (SteerMax - 200);
  // record the minimum steer sensor value
   if (SteerValue < SteerMin) { SteerMin = SteerValue;}
    SteerOnBelow = (SteerMin + 200);
   // signal the end of the calibration period
   digitalWrite(13, LOW);
}
}
 void loop() {
int strduration = pulseIn(steer_read, HIGH);
if (strduration <= SteerOnBelow || strduration >= SteerOnAbove){
  if (strduration <= SteerOnBelow){
    //Turn Left
    unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval_for_flashers) {
     // save the last time you blinked the LED 
     previousMillis = currentMillis;   

     // if the LED is off turn it on and vice-versa:
     if (ledState_leftts == LOW)
       ledState_leftts = HIGH;
     else
       ledState_leftts = LOW;

     // set the LED with the ledState of the variable:
     digitalWrite(led, ledState_leftts);
     digitalWrite(left_ts, ledState_leftts);
     }
 }//close if below
if (strduration >= SteerOnAbove){
  //Turn Right
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval_for_flashers) {
     // save the last time you blinked the LED 
     previousMillis = currentMillis;   

     // if the LED is off turn it on and vice-versa:
     if (ledState_rightts == LOW)
       ledState_rightts = HIGH;
     else
       ledState_rightts = LOW;

     // set the LED with the ledState of the variable:
     digitalWrite(led, ledState_rightts);
     digitalWrite(right_ts, ledState_rightts);
   }
}
//clost if > above
}
else {
  digitalWrite (left_ts, LOW);
  digitalWrite (right_ts, LOW);
  digitalWrite (led, LOW);
}
//close the loop
Serial.println(SteerOnBelow);
Serial.println(SteerMin);
Serial.println(SteerOnAbove);
Serial.println(SteerMax);
}