Instructions
338Libraries
© 2013 Conrad Electronic
+5Volt ist the supply voltage of the servo, it must provide enough current to drive the servo. The
ground of the servo and the ground of the C-Control Pro unit must be the same. The pulse for the
servo is generated by the PWM signal of the C-Control unit.
5.22.1 Servo_Init
Servo Functions Example
Syntax
void Servo_Init(byte servo_cnt, byte servo_interval, byte ramaddr[],
byte timer);
Sub Servo_Init(servo_cnt As Byte, servo_interval As Byte,
ByRef ramaddr As Byte, timer As Byte)
Description
Intializes the internal servo routines. The servo_cnt parameter controls how many servos can be
driven at the same time. The servo_interval parameter describes the period length (10 or 20ms), with
timer the used 16-Bit timer can be chosen. Timer 3 is only available on the Mega128. The user must
supply ram space to operate the servos. The required size is servo_cnt * 3. E.g., if the user wants to
operate 10 servos, at byte array of 30 bytes is needed.
The user supplied ram space must be available the whole time the servos are working. Since after
leaving a function the local variables are no longer available, it is most times a good idea to provide the
user supplied ram as a global variable.