How to read the load from a load cell

Why exactly 4?
The values from the library will not be in the range 0-1023, it will be grams (0-20000gr) or kilograms or, in general, abstract units

Oh right. so how would the motor know when to spin at full throttle? What would the unit transformation have to be in this case then. Would I need to make it that the max value 1023 = 20000gr and min value 0 = 00000gr?

This will only work if --
value = ananlogRead(AX);

1. You can use dedicated library like HX711.h or convert the following timings (Fig-1) into programming codes:


Figure-1:

2. The following sketch acquires Load Cell signal in the form of counts which you can use as dutyCycle argument in analogWrite(DPin, 8-bitDutyCycle); function after proper mapping

/* This program takes 10 samples from LC + HX711B at
   1-sec interval and then computes the average.
*/

unsigned long x = 0, y = 0;
unsigned long dataArray[10];
int j = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(A1, INPUT); //data line  //Yellow cable in my Setup
  pinMode(A0, OUTPUT);  //SCK line  //Orange cable in my Set up
}

void loop()
{

  for (int j = 0; j < 10; j++)
  {
    digitalWrite(A0, LOW);//SCK is made LL
    while (digitalRead(A1) != LOW) //wait until Data Line goes LOW
      ;
    {
      for (int i = 0; i < 24; i++)  //read 24-bit data from HX711
      {
        clk();      //generate CLK pulse to get MSB-it at A1-pin
        bitWrite(x, 0, digitalRead(A1));
        x = x << 1;
      }
      clk();  //25th pulse
      Serial.println(x, HEX);
      y = x;
      x = 0;
      delay(1000);
    }
    dataArray[j] = y;
  }

  Serial.println("===averaging process=========");
  unsigned long C1 = 0;   //

  for (j = 0; j < 10; j++)
  {
    C1 += dataArray[j];
  }
  Serial.print("Average Count = ");
  C1 = C1 / 10;
  Serial.println(C1, HEX);
}

void clk()
{
  digitalWrite(A0, HIGH);
  delayMicroseconds(50);
  digitalWrite(A0, LOW);
}
ananlogWrite(map(C,  C0, C20, 0, 255));  //C0 = counts with no load; C20 = counts with Full Load 

You must specify the dependence of the motor speed on the scale weight yourself, in the program code. Do you plan to write program yourself? Do you read about map() function?

I think, when you start write the code - many of your questions will disappear by themselves. try to do it and returns, if you meet the difficulties

@movz18
If you solved your problem, please mark the thread as completed

I do plan to write a program myself yes, by specifying the dependence of the motor speed on the scale weight in the code, do you mean, I set a certain weight, such as 20kg to 1023(so max motor speed), and 0kg to 0(min motor speed). As in I code this in to my program.