struct servo_data{ //Structure for servo channel, position. char servo_no; unsigned int servo_pos; }; struct arm_pos{ //Data structure for five servos. struct servo_data sd[5]; }; void send_arm_pos(struct arm_pos temp); void send_servo_cmd(char channel, unsigned int position); struct arm_pos pos_seq[5] = { { {{0,300},{1,300},{2,300},{3,300},{4,300}} }, { {{5,300},{6,300},{7,300},{8,300},{9,300}} }, { {{0,300},{1,300},{2,300},{3,300},{4,300}} }, { {{5,300},{6,300},{7,300},{8,300},{9,300}} }, { {{0,300},{1,300},{2,300},{3,300},{4,300}} } }; void putch(char c) //DBug12 Function. { __asm__ __volatile__ ("ldy #0xee86"); __asm__ __volatile__ ("jsr [0,y]"); } void send_servo_cmd( char channel, unsigned int position) { putch(channel+'0'); } void send_arm_pos(struct arm_pos ap) { int i; for(i = 0; i < 5; i++) { send_servo_cmd((ap.sd[i]).servo_no, (ap.sd[i]).servo_pos); //Doesn't work. } } int main(void) { send_arm_pos(pos_seq[1]); return 0; }