Answers.Body: <p>Yes you can do this in the standard EV3 software.</p>
  
  <p>Make a block that waits until the Light Sensor goes "dark". Connect this to a Timer block, and start a new timer (reset Mode). Connect that block to a new Wait block, which waits until the Light Sensor goes "light" again. Then use another Timer block, this time in Measure Mode, to get the duration since the start of the timer (which is the time since the sensor went "dark").</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-21T18:27:56.370Z
Answers.LastActivityDate: 2015-10-21T18:27:56.370Z
Answers.UserDisplayName: Phil B.
Body: <p>I am quite new to LEGO Mindstorms, and can't seem to wrap my head around this one.</p>
  
  <p>I am making a size sorting machine, sorting brick sizes depending on the time they take to pass the lightsensor.</p>
  
  <p>So I am wondering if it's possible to time how long the lightsensor has a different value from normal, and then use this value to choose where to throw the brick.</p>
  
  <p>Basically I need the time the lightsensor is "not" or doesn't receive light.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-21T18:05:33.210Z
Comments.Text: Welcome to StackExchange! Can you clarify what you are using to program the Mindstorms EV3? What you want to do is definitely possible (provided speeds are not too high) but how to do it depends on the program you use (e.g. LEGO's programming suite, or LeJOS, or ev3dev)...
Comments.UserDisplayName: Phil B.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-21T18:10:48.157Z
Comments.Text: pretty sure its called "lego mindstorm education ev3 software" for students.
Comments.UserDisplayName: Rafen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-22T16:54:23.070Z
Comments.Text: If you're sorting bricks with a fixed width and variable length such as beams, axles and certain bricks you might be able to build a purely mechanical solution such as [this](https://www.youtube.com/watch?v=nlCSlJuD65A).
Comments.UserDisplayName: Ambo100
Tags: <ev3><ev3-g>
Title: Sizesorting machine
UserDisplayName: Rafen
ThreadText: # Sizesorting machine
  
  (Asked by: username_0 on 2015-10-21)
  
  I am quite new to LEGO Mindstorms, and can't seem to wrap my head around this one.
  
  I am making a size sorting machine, sorting brick sizes depending on the time they take to pass the lightsensor.
  
  So I am wondering if it's possible to time how long the lightsensor has a different value from normal, and then use this value to choose where to throw the brick.
  
  Basically I need the time the lightsensor is "not" or doesn't receive light.
  
  **Tags:** ev3, ev3-g
  
  > **Comments:**
  > **username_1**: Welcome to StackExchange! Can you clarify what you are using to program the Mindstorms EV3? What you want to do is definitely possible (provided speeds are not too high) but how to do it depends on the program you use (e.g. LEGO's programming suite, or LeJOS, or ev3dev)...  
  > **username_0**: pretty sure its called "lego mindstorm education ev3 software" for students.  
  > **username_2**: If you're sorting bricks with a fixed width and variable length such as beams, axles and certain bricks you might be able to build a purely mechanical solution such as [this](https://www.youtube.com/watch?v=nlCSlJuD65A).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-21. Score: 2
  
  Yes you can do this in the standard EV3 software.
  
  Make a block that waits until the Light Sensor goes "dark". Connect this to a Timer block, and start a new timer (reset Mode). Connect that block to a new Wait block, which waits until the Light Sensor goes "light" again. Then use another Timer block, this time in Measure Mode, to get the duration since the start of the timer (which is the time since the sensor went "dark").
  
  
  ---
  
  