We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2018-08-22
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Servo
Downloaded: 5160 times
Not followed.
License: MIT license
Servo click is a 16-channel PWM servo driver with the voltage sensing circuitry. It can be used to simultaneously control 16 servo motors, each with its own programmable PWM signal.
Do you want to subscribe in order to receive notifications regarding "Servo click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Servo click" changes.
Do you want to report abuse regarding "Servo click".
Library Description
This library will allow you to control multiple servo motors at once.
Key functions:
void servo_init(uint8_t minPosition, uint8_t maxPosition, uint16_t lowResolution, uint16_t highResolution);
- Main click board initialization routine.void servo_setMode(uint8_t mode,uint8_t _data);
- Set's the operation mode of the click board.servo_sleep();
- The function needs to be set before setting the frequency.void servo_setFREQ(uint16_t freq)
; - Used for setting the frequency.void servo_setPosition(uint8_t motor, uint8_t position);
- Set the position of the selected servo motor.Example description
The application is composed of three sections:
void applicationTask()
{
servo_setPosition(_SERVO_MOTOR_1, 0);
Delay_ms( 2000 );
servo_setPosition(_SERVO_MOTOR_1, 90);
Delay_ms( 1000 );
servo_setPosition(_SERVO_MOTOR_1, 180);
Delay_ms( 2000 );
servo_setPosition(_SERVO_MOTOR_1, 90);
Current = setvo_getCurrent(_SERVO_POSITIVE_CH0);
IntToStr(Current , text);
mikrobus_logWrite( "Current - ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " mA", _LOG_LINE );
Delay_ms( 1000 );
}
Other MikroElektronika libraries used in the example:
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.