Servo Array in 12 Servo Control Program


i've done bit of research, found nothing answered specific problem.

among other messes, have servo declaration in start of program contains following:
code: [select]
//---servos: 12 x hs-5645mg (~750us - ~2200us)------
int servolist[12] =           {0,    1,    2,    12,   13,   14,   16,   17,   18,   28,   29,   30};  //servo pin #
int servocenters[12] =        {1800, 1900, 1250, 1200, 1100, 1750, 1200, 1100, 1750, 1800, 1900, 1250}; // starting position of each servo moves body nice standing state
int servo_out_up_limit[12] =  {2200, 750,  700,  750,  200,  750,  750,  2200, 750,  2200, 750,  2200}; physical or digital limits of each servo moving away or body
int servo_in_down_limit[12] = {1000, 2000, 2200, 1500, 1100, 2200, 2000, 1100, 2200, 1500, 1900, 750}; // physical or digital limits of each servo moving towards or down body
int servogroup[12] =          {1,    1,    1,    2,    2,    2,    3,    3,    3,    4,    4,    4,};


i need way control 12 servo in 3-dof quadruped, wanted keep things relatively clean , use single function multiple arguments control each servo. problem of servos inverted, (due asymmetrical nature of quadruped) have physical limits. servos used y movement , x shifts.

is there simpler way address aspects of servo in 1 call?
ex: servomove(sev_number, inverted?, center?, distance_of_move)
taking account boundaries , correcting limiting movement.



my biggest problem i'm totally overwhelmed when 12 servos move @ once, i'm trying track errors , whatnot, it's hard @ each servo.

i want able use number in simple data range (say 0--->255) , have same distance, move, , direction every single servo.

i picked , arduino after bit , pretty rusty, have servo controller that's taking these commands on serial (ssc-32)

quote
is there simpler way address aspects of servo in 1 call?
simpler what?

you know, comments not have on same line statement go with. not having scroll 6 screens sideways thing.


Arduino Forum > Using Arduino > Programming Questions > Servo Array in 12 Servo Control Program


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code