Before I explain my problem, let me first explain my project.
I am currently trying to make an autonomous quadcopter with an Arduino Uno as the "brain". To save processing power (and time) I am having the Kkmulticopter V5.5 Controller BlackBoard handle the PID, balancing, etc. I am having the Arduino Uno act as a RC receiver, as its ports connect directly into the kkboard, and output the PWM signals needed to imitate specific channels. It is through this way that the Arduino Uno is able to control the quad. If you want to see pictures of my setup I'll be glad to post them.
Now for my problem...
As I stated above, the uno is the "brain" of the quad, so it controls navigation, direction and other autonomous functions. I have gotten the code written to where it reads the gyro sensor (x,y,z), and makes sure the quad stays within a set window of values.
Thats what it should do, but it doesn't.
From what I am seeing from motor movement, is that it's taking too much time to execute certain lines of code, which is messing with the PWM outputs to the kkboard.
Below is my code (not including the gyro sensor library)
My code exceeds the 9000 character limit, so here is a link to my repository. My main programs are:
The rest are for the gyro.
My question is this: Do I need another board (for more processing power), or am I just really inefficient in how I programmed my code?
Thanks ahead of time. :)