Skip to content

Servo — set angle 0 to 180° (servo_angle)

What it does: Sets the target angle of a classic RC servo on the selected channel.

servo_angle

Inputs

  • Field ID: servo channel number (1 to 8).
  • uhel: desired angle in the range of approximately 0 to 180.

Output

  • None (statement block).

When to use it

  • For positioning a common servo (arm, valve, mechanism).
  • When you want to switch to a specific position.

Tips and pitfalls

  • When using drives, also use a block to stop them when you press the STOP button in ESP IDE. Block: Execute this code on program exit
  • The actual mechanical range of the servo may not be a full 180°.
  • At extreme values, the servo can vibrate or overload.

Usage example

example_servo_angle

Open example in ESP IDE

Generated Python example

servo1.write_angle(int(90))