I want to be able to add to the position incrementally every second so say servo A starts at 1000 and moves 100ms every second and servo B starts at 1000 and moves 10ms every second.
I know I have to define two values, add to them every pass, then send that value to the servo position but I am slightly unsure on how to code this.
Break it down into several, smaller problems -- you need to:
Measure the passing of time (so you can do something once every second)
Change a value
Write the changed value
So, consider the following pseudo-code and go from there..
if currentTime - lastTime greater than threshold
then
increment value
write to motor
set lastTime to now
To change the value in a variable, just set its new value - you can even use its old value to set it, e.g.:
var1 = var1 + 10;
The scope of the variable determines its life... If you declare it global (outside of a function), any changes you make are global, you can access it again from anywhere else, e.g.: