Skip to content

Servo 360° — set speed -100 to 100 (set_servo_speed)

What it does: Sets the speed and direction of a continuous (360°) servo.

set_servo_speed

Inputs

  • Field ID: servo channel number (1 to 8).
  • speed: speed -100 to 100 (0 means stop).

Output

  • None (statement block).

When to use it

  • For continuous and positioning servos controlled by a value in percentages -100% to 100%.
  • For carriages, feeders or simple drives controlled by joystick or ESP NOW RC.

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
  • This block can also be used for classic position servos that we want to control with a joystick or with ESP NOW RC in the range -100% to 100%.
  • The direction of rotation depends on the connection and possibly the reverse direction of rotation setting during initialization.

Usage example

example_set_servo_speed

Open example in ESP IDE

Generated Python example

servo1.write_speed(int(40))