OSRBOT
OSRCORE LEARN
Open lesson
Skip to content

03 · Servo & ESC ​

Open this interactive lesson and device downloads

Goal ​

Set a fixed servo pulse instead of sweeping automatically. GPIO2 produces 50 Hz PWM with a 1000–2000 µs pulse (1500 µs default). GPIO1 remains at the 1500 µs ESC neutral signal.

Wiring and operation ​

Use EX2 row 8: GPIO2, VCC_ESC, GND. Power the servo according to its rating and share ground with the board. VCC_ESC is separate from the ordinary 5 V supply domain. Check connector orientation in the board view.

Start at 1500 µs and make small adjustments. Browser angles approximate a typical servo; actual travel depends on the device. Install this lesson, connect over USB and select “Apply to controller” to change the physical pulse. Moving a slider alone does not drive hardware.

Source: 03_pwm_servo/main/main.c. Check the pulse in the device log.

Exercise ​

Compare one parameter change at a time and record the observed hardware result.

Code ​

PWM setup and duty conversion are in main.c. The GPIO2 pulse width can be updated through the browser parameters.

Verification ​

Check pulse width before attaching a mechanical load. The servo determines whether 1500 µs corresponds to its center.


Learn, build and control robots with OSRCORE.