Set shaft position of standard servo motor
Set the shaft position of a standard servo motor, from 0 to 180 degrees.
To rotate the servo shaft, send values from 0 to 180 to the block input.
Sending out-of-range values, such as -5 or 200, to the block input has the same effect as sending the maximum or minimum input values.
The block input inherits the data type of the upstream block, and internally converts it to uint8.
If you run a simulation of a model that contains this block without the target hardware, this block does nothing. See Block Produces Zeros or Does Nothing in Simulation.
Do not use Servo blocks with External mode.
If you use this block in models with the Serial Receive and Serial Transmit blocks, use longer sample times to avoid overruns.
The maximum number of Servo blocks per model is 12 for Arduino Uno / Nano hardware, and 48 for Arduino Mega 2560 hardware.
With Arduino Uno hardware, the Arduino PWM block cannot use digital pins 9 or 10 when the model contains Servo blocks.
With Arduino Nano hardware, the Arduino PWM block cannot use digital pins 9 or 10 when the model contains Servo blocks.
With Arduino Mega 2560 hardware, the Arduino PWM block cannot use digital pins 11 or 12 when the model contains more than 12 Servo blocks.
Enter the number of the digital pin.
Do not assign the same pin number to multiple blocks within the model.
If you set the Target hardware parameter to:
Arduino Mega 2560, enter a pin number from 0 to 53.
Arduino Uno, enter a pin number from 0 to 13.
Arduino Nano, enter a pin number from 0 to 13.