I'm trying to work out the programming in my mind for a project I'm nearly ready to start building. I seem to have come a little stuck trying to work out the programming side of things. I'm not even sure if its possible to do what I want to do and was wondering if you guys could help.
The basic idea is...
I have a few motors that are controlled by 4 separate servo connections. For the motors to stay running each of the 4 servos needs to receive a signal every 40ms even if the speed remains constant. I'm told there is little play in the 40ms timing.
I also have a GPS that updates every 200ms.
From the GPS information I need to do a small amount of math and make a few decisions and then use that information to decide on changes in speed to be made in the motors.
Its fine for the changes in speed to be made slower than the GPS updates. I just have no idea how to do the math from the GPS updates, change the motor speeds and make sure each of the 4 servo channels gets a signal every 40ms.
Is it even possible? I can't seem to make it work in my mind.
I'm a bit of a programming noob so I'm sorry if the answer is obvious.