The light sensor is still pretty jittery, but with the increased speed of BrickOS (at least 10x, maybe more) I now have the time to sample the sensor over a longer period to average out the wiggles. Taking 3 samples over 3 ms made the above pictured 5:1 ratio come out dead-on accurate even after 6 fast cranks of the big handle ( == 30 revolutions of the wheel, which itself has 6 light/dark transitions for each revolution, for a final "pulse" count of 180).
BrickOS is pretty awesome, but the documentation is totally non-existent and development seems to have stopped. But it works find as-is the the code is right there to examine, so I'll stick with it. Next I have to do a little experimenting and calculation to determine how much of a tilt translates into how much rotation and how fast those both occur.
No comments:
Post a Comment