We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How do I decide which ARM board to go for if I am aiming to use it as a micro-controller to run sensors, actuators, motors, and solar panels? And I wish to power up the board via Li-ion battery pack.
The distance between your CubeSat and the sun is hopefully around 18 lightminutes.
But I think you mean how to find out how much you need to rotate the CubeSat ?
You could collect a number of ADC samples - say 16 for each of the sensors.
Then averaging these results into one value per sensor.
Now you find the two sensors which have the highest values.
If those two sensors are on each side on the cube, you're having a problem: The moon.
-But if the sensors are adjacent, then let's assume you're using a 10-bit ADC (which will give you values between 0 and 1023):
A simple draft would be something like this:
int32_t position = ((value2 + 1) << 16) / ((value1 + 1) << 16);
That would give you a value between 0 and 67108864.
You could subtract (512 << 16) from that value in order to get a signed integer, where 0 is the middle, negative is towards the sensor which provided value1, positive is towards the sensor which provided value2.
You may also want to get familiar with PID, which you can probably use for more than one thing. Just make sure you get things right, so it won't become completely erratic and out-of-control.