Input on how to go about this code

Hey y'all. My project is coming along, but slower than I'd like. I'm to the point where I don't know how to go about this anymore. I am going to use a potentiometer to change the "pressure/weight" value so that I can bench test this system before testing on the machine. I will be able to change the pressure reading and see what the relays do. I am going to have two LCD readouts, a keypad or potentiometer to change the "desired" downforce. So in the code I will tell the system what I want and it will maintain the weight, when I change the pressure, I will do it, but I need to keep the system from chasing its tail. In other words, constantly raising or lowering the pressure to try to get the exact value. Would rounding the "pressure" reading in step values i.e. 10,20,30 psi be better than 20,21,22,23? And how would I do that? I'm getting the pressure reading, then calculating the downforce from there, and I will be telling the system what downforce to achieve.

So in all I have 4 questions:

  1. If/Else commands - If the actual is more or less than desired, make the change, within 10lbs, then stop. - Am I close? Or no where near that?

  2. If/Else commands - How would I put a buffer in to keep it from being over active i.e. desired is 200, it achieves 215 with the fill relay, then fires the exhaust relay to make it 200 and gets 185, then fires the fill solenoid on and on.

  3. If the actual is "X" lbs higher or lower than desired turn pin 13 LOW(light up LED or sound buzzer) - Am I close there? Don't know what that should be yet, I don't want nuisance warnings.

  4. How do I go about giving rounded readings? Example - Pressure sensor reads 42 psi, make it show 40 psi, or it reads 66 psi, make it round to 70 psi. I don't know the step value I want yet, but 5 or 10 psi would be fine, so 50,60,70, or 50,55,60,65.

#include <SPI.h>
#include <SoftwareSerial.h>
#include <ArduinoBlue.h>
#include <Wire.h>
int rawValue= 50; // A/D readings
int offset = 51; // zero pressure adjust
int fullScale = 1085; // max pressure (span) adjust
float pressure; // final pressure
float weight; // Actual added downforce
float setpoint;// Desired added downforce
#define BT_SERIAL_RX 11//software serialRX pin
#define BT_SERIAL_TX 10//Software serialTX pin
SoftwareSerial BluetoothSerial(BT_SERIAL_RX, BT_SERIAL_TX);
int Alarm = 13;// alarm control
#define ON   0
#define OFF  1
int IN1 = 6;// relay1(fill) control pin
int IN2 = 5;// relay2(exh) control pin
pinMode(IN1, OUTPUT)
pinMode(IN2, OUTPUT)
digitalWrite(IN1, status_1)
digitalWrite(IN2, status_2)
relay_SetStatus( unsigned char status_1,  unsigned char status_2)

void setup() {
  Serial.begin(9600);
  BluetoothSerial.begin(9600);
  relay_init();
  pinMode(13, OUTPUT);
}

void loop() {
  rawValue = analogRead(A0);// Press sensor signal in
  pressure = (rawValue - offset) * 1.2 / (fullScale - offset)*139; // pressure conversion
  weight = (pressure * 3.81)-7.15;// pressure to weight conversion
  BluetoothSerial.print(pressure,0);// press readout
  BluetoothSerial.print(weight,0);// weight readout
  if (setpoint < weight){// Setpoint less than actual.... Need to limit it within ~15 lbs
    relay_SetStatus(ON,OFF), delay(2000);//turn on RELAY_1(fill)
    // Need a smoothing device or ON/OFF pulsing so the system doesnt constantly turn relays on and off/ or turn relay on for "X" milliseconds and check to see if its true or not.
  }
  else{ // Setpoint more than actual... Need to limit within ~ 15 lbs
     relay_SetStatus(OFF, ON), delay(2000);//turn on RELAY_2 (exh)
      //Need a smoothing device or ON/OFF pulsing so the system doesnt constantly turn relays on and off/ or turn relay on for "X" milliseconds and check to see if its true or not.
    }
 if ((weight < setpoint - 40)||(weight > setpoint + 40)){// Warning that actual is out of range
  digitalWrite(13, LOW);// sounds alarm or lights up LED.
 }
  }

Your code does not even compile. You need to have all those initial function calls inside your setup() routine

void setup() {
  Serial.begin(9600);
  BluetoothSerial.begin(9600);
  relay_init();
  pinMode(13, OUTPUT);
  pinMode(IN1, OUTPUT)
  pinMode(IN2, OUTPUT)
  digitalWrite(IN1, status_1)
  digitalWrite(IN2, status_2)
  relay_SetStatus( unsigned char status_1,  unsigned char status_2)
}

You also don't separate command by a comma

    relay_SetStatus(ON, OFF), delay(2000); //turn on RELAY_1(fill)

you separate them by a semicolon (and typically on their own line)

    relay_SetStatus(ON, OFF);
    delay(2000); //turn on RELAY_1(fill)

It is also very helpful to run the auto format function in the IDE (Ctrl-T) and align your code.

As for rounding, that is simple math that you can figure out.

int IN1 = 6;// relay1(fill) control pin
int IN2 = 5;// relay2(exh) control pin
pinMode(IN1, OUTPUT)
pinMode(IN2, OUTPUT)

I almost tossed my cookies. Why would you name a variable INsomething when it is an OUTPUT?

Part of that code was from a copy and pasted sketch to get the relays working all by itself. I was tying that sketch into mine. It didn't work, obviously. I actually since then found a different sketch to base off of, that, hard to believe, is easier to adapt.

So, I'm not the best with math, much less math intertwined with C++, hence why I am seeking guidance.

Are my IF/ELSE statements even close to what I am wanting to do?

Thank you for the Ctrl+T info, did not know about that.

Are my IF/ELSE statements even close to what I am wanting to do?

I can't tell, since your code is so poorly laid out. Hint, hint.