I have a project where I'm using the HX711 library with a loadcell to weigh in a fruit that is on a conveyor belt. Each fruit has a weight which needs to be classed. The bigger fruits (200g) are class A so they have to "fall down" the conveyor belt at a later stage. The smaller fruits fall down earlier. This has to be done on a timed basis.
What I want to do is get the fruit size , calculate the class (using weight) and then send an interrupt to the dropping mechanism after x time. But while it must wait to drop the next fruit will be have come in and might be smaller than the first.
I can already weigh in and calculate the class of fruits. I've also done this in C using multithreading but adruino uno doesn't support that.
I also have to mention that there is about 50-200 fruits on a single conveyor belt at any given time.
millis()
is the answer. Look at the BlinkWithoutDelay example, that comes with the Arduino IDE