mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-04 17:19:20 +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.motor3_rpm_pcm = 0;
|
||||||
m.motor4_rpm_pcm = y;
|
m.motor4_rpm_pcm = y;
|
||||||
}
|
}
|
||||||
// DIAGONALLY FORWARD AND REVERSE
|
// DIAGONALLY FORWARD
|
||||||
if ((x > 0) && (y > 0 && y < 500)) {
|
if ((x > 7400) && (y > 7440)) {
|
||||||
m.motor1_rpm_pcm = x; // left, forward
|
m.motor1_rpm_pcm = x; // left, forward
|
||||||
m.motor2_rpm_pcm = x; // right, forward
|
m.motor2_rpm_pcm = 0; // right, forward
|
||||||
m.motor3_rpm_pcm = 0;
|
m.motor3_rpm_pcm = x;
|
||||||
m.motor4_rpm_pcm = 0;
|
m.motor4_rpm_pcm = 0;
|
||||||
}
|
}
|
||||||
else if ((x < 0) && (y > 0 && y < 500)) {
|
else if ((x < 0) && (y > 0 && y < 500)) {
|
||||||
m.motor1_rpm_pcm = 0;
|
m.motor1_rpm_pcm = 0;
|
||||||
m.motor2_rpm_pcm = 0;
|
m.motor2_rpm_pcm = -x;
|
||||||
m.motor3_rpm_pcm = -x;
|
m.motor3_rpm_pcm = 0;
|
||||||
m.motor4_rpm_pcm = -x;
|
m.motor4_rpm_pcm = -x;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user