Now that I had a LEGO motor and a motion sensor, I merged the two together to make a simple counter of the number of rotations of the motor. Using PicoBlock, I wrote a small program which counts the number of times the light intensity on the photocell drops below a certain point.
Then I placed the LEGO motor near the photocell, so that every time its blade rotates, a shadow falls on the photocell. By trial-and-error I found the cut-off intensity between light-and-shadow of the blade. And just like that, we have a "rotation counter". As an added spark, I made the light flash as the blade passes over the photocell :)
No comments:
Post a Comment