mirror of
https://github.com/modelec/PAMI-2025.git
synced 2026-03-18 21:40:36 +01:00
add multi core, servo class
Use core 0 for ultrasonic detection Use a custom class to pilot servo
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user