get_error 롤백
This commit is contained in:
@@ -42,13 +42,13 @@ void motor_move(int32_t left, int32_t right) {
|
||||
} else if (left >= 0 && right < 0) {
|
||||
// fwd back
|
||||
P3->OUT |= 0xc0;
|
||||
P5->OUT |= (P5->OUT & (~0x30)) | 0x10;
|
||||
P5->OUT |= (P5->OUT & (~0x30)) | 0x20;
|
||||
pwm_set_duty_left((uint16_t) left);
|
||||
pwm_set_duty_right((uint16_t) (-right));
|
||||
} else if (left < 0 && right >= 0) {
|
||||
// back fwd
|
||||
P3->OUT |= 0xc0;
|
||||
P5->OUT |= (P5->OUT & (~0x30)) | 0x20;
|
||||
P5->OUT |= (P5->OUT & (~0x30)) | 0x10;
|
||||
pwm_set_duty_left((uint16_t) (-left));
|
||||
pwm_set_duty_right((uint16_t) right);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user