code review

help me slim this piece up a touch, i know theres got to be easier ways to do this

void loop()
{
  delay (12); //1200 Most useful for tuning, sensor read time

  if  (analogRead(0) < Trigger){
    sensorstate = LOW;}
    else {sensorstate = HIGH;}
  
  

  
  if (sensorstate = LOW)  {unsigned long currentmillis = millis();}
  







while (currentMillis - previousMillis < readtime)
  {  
    if  (analogRead(0) < Trigger){
      (++ForkLoad);
    } // if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
    else // do nothing
    if (analogRead(0) > 100) {
      digitalWrite (LEDpinlowred, 1);
    }
    if (analogRead(0) < 100) {
      digitalWrite (LEDpinlowred, 0);
    }

    delay(1);


    if  (analogRead(1) < Trigger)  {
      (++ForkLoad);
    }  // if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
    else// do nothing
    if (analogRead(1) > Trigger) {
      digitalWrite (LEDpinmidred, 1);
    }
    if (analogRead(1) < Trigger) {
      digitalWrite (LEDpinmidred, 0);
    }
    delay(1);

    if  (analogRead(2) < Trigger)  {
      (++ForkLoad);
    }// if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
    else// do nothing
    if (analogRead(2) > Trigger) {
      digitalWrite (LEDpintopred, 1);
    }
    if (analogRead(2) < Trigger) {
      digitalWrite (LEDpintopred, 0);
    }

    

  }
  
  
  
   if(currentMillis - previousMillis < readtime) {
         
        previousMillis = currentMillis;
   


if (sensorstate = LOW){
    delay(3000);
  }

It’d be easier to read if the whitespace were trimmed, and the indentation sorted out.
It’d be easier to maintain if some names were hung on those pin numbers.

if (sensorstate = LOW)  {unsigned long currentmillis = millis();}

That construct is going to be disappointing in at least two ways.

if (analogRead(0) > 100) {
      digitalWrite (LEDpinlowred, 1);
    }
    if (analogRead(0) < 100) {
      digitalWrite (LEDpinlowred, 0);
    }

Read once, test as many times as you like. What if they’re equal?

Analog inputs 0,1,2 are sensors at different heights, sorry about the blank spaces, helps me organize thought, Ideally I want to have a timer start when the lowest (A0) is below a threshold. When the timer reaches 500 mills disregard all readings for the next 3000 mills. I feel like i'm really close it just wont work. :~

sorry about the blank spaces, helps me organize thought

Good indentation will help a whole lot more.

Ideally I want to have a timer start

Have another look at the construct that I said would disappoint.

If I’m not mistaken this code is not complete.

This does nothing useful -

    if ( sensorstate = LOW )
    {
        unsigned long currentmillis = millis();
    }

White space

is one thing.

Your white space

is something else.

Annoying is what it is.

I suggest you post the whole code of your project.

This does nothing useful

That's why I said it would disappoint.

if ( sensorstate = LOW )
    {
        unsigned long currentmillis = millis();
    }

There are at least two things wrong with it!