Μετάβαση στο περιεχόμενο
GET /v1/duty

PWM period and duty cycle

Δοκιμάστε το ζωντανά

10 δωρεάν κλήσεις την ημέρα — χωρίς εγγραφή, χωρίς κλειδί API. Μέσω του gateway του oanor.

Προσαρμοσμένες κεφαλίδες (προαιρετικά)
api.oanor.com/servo-api

Δουλεύει. Πάρε ένα κλειδί API και χρησιμοποίησέ το στο έργο σου.

Λάβετε ένα κλειδί API

Αποσπάσματα κώδικα

curl "https://api.oanor.com/servo-api/v1/duty" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/servo-api/v1/duty", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/servo-api/v1/duty");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/servo-api/v1/duty",
    headers={"x-oanor-key": "oanor_test_..."}
)

Παράδειγμα απόκρισης

Πραγματική απόκριση αυτού του endpoint, από τον τελευταίο έλεγχο υγείας.

{
    "data": {
        "note": "The refresh frequency sets the frame: a standard 50 Hz servo signal has a 20 ms (20,000 µs) period, so a 1500 µs pulse is just 7.5 % duty cycle. The servo only cares about the pulse width, but the controller's PWM peripheral is configured in duty, so this conversion sets the timer. Digital servos and multirotor ESCs often run faster frames (e.g. 333 Hz) for crisper response — drop the frequency in to see the new duty.",
        "inputs": {
            "pulse_us": 1500,
            "frequency_hz": 50
        },
        "period_ms": 20,
        "period_us": 20000,
        "off_time_us": 18500,
        "duty_cycle_pct": 7.5
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:51.321Z",
        "request_id": "b29dd58a-576a-43a7-a81d-c7607e651ce2"
    },
    "status": "ok",
    "message": "PWM duty",
    "success": true
}