mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-10-10 18:37:25 +00:00
PWM
This commit is contained in:
@@ -118,10 +118,18 @@ static void update_pwm (int rc_x, int rc_y) {
|
|||||||
// Pass PWM values to the proper DC motors depending on the joystick y-axis position
|
// Pass PWM values to the proper DC motors depending on the joystick y-axis position
|
||||||
// Forward
|
// Forward
|
||||||
if (y_val > y_centered) {
|
if (y_val > y_centered) {
|
||||||
m.
|
m.motor1_rpm_pcm = motor_a_speed;
|
||||||
|
m.motor2_rpm_pcm = motor_b_speed;
|
||||||
|
m.motor3_rpm_pcm = 0;
|
||||||
|
m.motor4_rpm_pcm = 0;
|
||||||
}
|
}
|
||||||
// Reverse
|
// Reverse
|
||||||
if (y_val < y_centered) {}
|
if (y_val < y_centered) {
|
||||||
|
m.motor1_rpm_pcm = motor_a_speed;
|
||||||
|
m.motor2_rpm_pcm = motor_b_speed;
|
||||||
|
m.motor3_rpm_pcm = 0;
|
||||||
|
m.motor4_rpm_pcm = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user