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.

  • 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)... – Phil B. Oct 21 '15 at 18:05
  • pretty sure its called "lego mindstorm education ev3 software" for students. – Rafen Oct 21 '15 at 18:10
  • 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. – Ambo100 Oct 22 '15 at 16:54

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").

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.