add multi core, servo class

Use core 0 for ultrasonic detection
Use a custom class to pilot servo
This commit is contained in:
Florent
2026-03-11 17:36:49 +01:00
parent ccc9c03168
commit 5f36968eaa
7 changed files with 209 additions and 200 deletions

View File

@@ -29,13 +29,3 @@ int getRotationSteps(float angleDeg) {
return (int) round(microStepsForAngle);
}
void setServoAngle(int angle, int channel) {
int value = map(angle, 0, 180, 544, 2400);
// Serial.print("Servo angle: ");
// Serial.println(value);
if (value < 544) value = 544;
if (value > 2400) value = 2400;
int duty = value * 65535 / 20000;
ledcWrite(channel, duty);
}