Tips on writing efficient code for Arduino

Some thoughts that may help you design your tracking algorithms.
Many years ago I read a detailed analysis in a technical journal (IBM Systems Journal) describing analysis of some factors affecting insolation (power delivered) from solar panels. I don't have details now, but key points I remember:

  1. Basic calculation is that collection efficiency varies with cosine of angle between perpendicular to panel face and the sun. Now remember that the peak of a cosine curve is quite flat, so moderate angular errors have little effect.
  2. Atmospheric pollution and haze affected that dramatically - reducing the sensitivity to the angle - making accuracy of "point to the sun" even less important.
  3. A reflector, perhaps wider than the panel mounted horizontally in front of the panel increased collection markedly at very low cost.
  4. If tilt angle is fixed, consider tilting to optimise winter collection - summer collection will be OK.

Hope these ideas help your design. ciao.