I would like to connect a bunch of light sensors in a grid so that I can trace a flashlight moving across them.
My goal is to measure acceleration and, ideally, direction, always from the one sensor in the grid that currently outputs the highest number (= receives the most light) to the next and so on.
Ideally I would like to trace greater movement vectors, that is, movement direction and acceleration/speed across multiple sensors in the grid.
Can anyone advise what would be a good strategy for doing this?
Need more information. Do you mean a point light source, rather than a "flashlight", which will illuminate a swath of sensors?
A point light source will probably illuminate several nearby sensors, in which case you can use interpolation to estimate its position at a point in time.
From a set of positions and timestamps, it is easy to calculate velocity and acceleration.
Well, I figured you can convert the flashlight into a point light source by only using data from the sensor that gives out the highest value at a given time.
Exact position is not needed, simply which sensor outputs the highest value at time x.
What are solutions for velocity and acceleration? I know this is very simple but I'm quite new to programming ...
A basic law of motion is that if you measure position x1 at time t1, and x2 at time t2, velocity in the x direction is (x2-x1)/(t2-t1). Similar for acceleration.
Start with keypad where pressing each button will turn on LED corresponding to that button, then replace buttons by light sensor, if you need more LEDs use keyboard program
Take the current X/Y position, and subtract the previous X/Y position. That gives you the velocity vector. Then you need to partition what angles count as which direction.