so here is my updated code:
boolean timingFlag;
timingFlag = true;
unsigned long timeOff;
unsigned long timingMillis;
if(timingFlag == false && scale.get_units() < -10)
{
timingFlag = true;
timingMillis = millis();
}
if(timingFlag == true && scale.get_units() >= -10)
{
Serial.print(" Time less than 10 = ");
timeOff = millis() - timingMillis;
Serial.println( timeOff );
timingFlag = false;
}
}
It does exactly what i need it to do. It starts measuring time when the weight is below 10 lbs. (WHICH IS AWESOME, THANK YOU GUYS!)
Now what i am trying to figure out is how to use the time measured to determine a a dollar amount in my code...
i am having trouble finding and using the time that was measured when the weight was off the scale..
I want the board to determine every second is worth 20 cents..
any ideas on how i could you the exact time amount the weight was off the scale in seconds and then multiple that by .20 to find the exact dollar amount?