mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-01 10:19:10 +00:00
directions
This commit is contained in:
@@ -167,17 +167,17 @@ static void update_pwm (int rc_x, int rc_y) {
|
||||
m.motor3_rpm_pcm = 0;
|
||||
m.motor4_rpm_pcm = y;
|
||||
}
|
||||
// DIAGONALLY FORWARD AND REVERSE
|
||||
if ((x > 0) && (y > 0 && y < 500)) {
|
||||
// DIAGONALLY FORWARD
|
||||
if ((x > 7400) && (y > 7440)) {
|
||||
m.motor1_rpm_pcm = x; // left, forward
|
||||
m.motor2_rpm_pcm = x; // right, forward
|
||||
m.motor3_rpm_pcm = 0;
|
||||
m.motor2_rpm_pcm = 0; // right, forward
|
||||
m.motor3_rpm_pcm = x;
|
||||
m.motor4_rpm_pcm = 0;
|
||||
}
|
||||
else if ((x < 0) && (y > 0 && y < 500)) {
|
||||
m.motor1_rpm_pcm = 0;
|
||||
m.motor2_rpm_pcm = 0;
|
||||
m.motor3_rpm_pcm = -x;
|
||||
m.motor2_rpm_pcm = -x;
|
||||
m.motor3_rpm_pcm = 0;
|
||||
m.motor4_rpm_pcm = -x;
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user