Code for ATmega2560 microprocessor controlling UAV. Navigation using sunshine direction, earth magnetic field, IMU and GPS.