Update ESP32 Arduino Core to v3.0.3

This commit is contained in:
Oleg Kalachev
2024-07-25 02:45:59 +03:00
parent 627233f862
commit e993dde355
4 changed files with 12 additions and 17 deletions

View File

@@ -20,17 +20,11 @@
void setupMotors() {
Serial.println("Setup Motors");
// configure PWM channels
ledcSetup(0, PWM_FREQUENCY, PWM_RESOLUTION);
ledcSetup(1, PWM_FREQUENCY, PWM_RESOLUTION);
ledcSetup(2, PWM_FREQUENCY, PWM_RESOLUTION);
ledcSetup(3, PWM_FREQUENCY, PWM_RESOLUTION);
// attach channels to motor pins
ledcAttachPin(MOTOR_0_PIN, 0);
ledcAttachPin(MOTOR_1_PIN, 1);
ledcAttachPin(MOTOR_2_PIN, 2);
ledcAttachPin(MOTOR_3_PIN, 3);
// configure pins
ledcAttach(MOTOR_0_PIN, PWM_FREQUENCY, PWM_RESOLUTION);
ledcAttach(MOTOR_1_PIN, PWM_FREQUENCY, PWM_RESOLUTION);
ledcAttach(MOTOR_2_PIN, PWM_FREQUENCY, PWM_RESOLUTION);
ledcAttach(MOTOR_3_PIN, PWM_FREQUENCY, PWM_RESOLUTION);
sendMotors();
Serial.println("Motors initialized");
@@ -51,10 +45,10 @@ uint8_t pwmToDutyCycle(uint16_t pwm) {
}
void sendMotors() {
ledcWrite(0, pwmToDutyCycle(getPWM(motors[0], 0)));
ledcWrite(1, pwmToDutyCycle(getPWM(motors[1], 1)));
ledcWrite(2, pwmToDutyCycle(getPWM(motors[2], 2)));
ledcWrite(3, pwmToDutyCycle(getPWM(motors[3], 3)));
ledcWrite(MOTOR_0_PIN, pwmToDutyCycle(getPWM(motors[0], 0)));
ledcWrite(MOTOR_1_PIN, pwmToDutyCycle(getPWM(motors[1], 1)));
ledcWrite(MOTOR_2_PIN, pwmToDutyCycle(getPWM(motors[2], 2)));
ledcWrite(MOTOR_3_PIN, pwmToDutyCycle(getPWM(motors[3], 3)));
}
void fullMotorTest(int n, bool reverse) {

View File

@@ -9,7 +9,7 @@
int channelNeutral[] = {995, 883, 200, 972, 512, 512};
int channelMax[] = {1651, 1540, 1713, 1630, 1472, 1472};
SBUS RC(Serial2);
SBUS RC(Serial2, 16, 17); // NOTE: remove pin numbers (16, 17) if you use the new default pins for Serial2 (4, 25)
void setupRC() {
Serial.println("Setup RC");