Subversion Repositories Projects

Rev

Rev 440 | Rev 449 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 440 Rev 442
Line 25... Line 25...
25
}
25
}
Line 26... Line 26...
26
 
26
 
27
/**
27
/**
28
 * test one or more motors
28
 * test one or more motors
29
 */
29
 */
30
void Handler::motor_test(sMotor motor) {
30
void Handler::motor_test(sMotorData motor) {
31
    char tx_data[12];
31
    char tx_data[MAX_MOTORS];
32
    for (int z = 0; z<12; z++)
32
    for (int z = 0; z<MAX_MOTORS; z++)
33
    {
33
    {
34
        tx_data[z] = motor.Speed[z];
34
        tx_data[z] = motor.desired_speed[z];
35
    }
35
    }
36
    com->send_cmd('t', ADDRESS_FC, tx_data, 12, false);
36
    com->send_cmd('t', ADDRESS_FC, tx_data, MAX_MOTORS, false);
Line 37... Line 37...
37
}
37
}
38
 
-
 
39
void Handler::reset_motor() {
38
 
40
    sMotor motor;
39
void Handler::reset_motor() {
41
    for (int z = 0; z<12; z++)
40
    for (int z = 0; z<MAX_MOTORS; z++)
42
    {
41
    {
Line 43... Line 42...
43
        motor.Speed[z] = 0;
42
        data->motor.desired_speed[z] = 0;
44
    }
43
    }
Line 45... Line 44...
45
 
44
 
46
    motor_test(motor);
45
    motor_test(data->motor);
47
}
46
}