#include <avr/io.h>
#include "Tlc5940.h"
Go to the source code of this file.
Defines | |
| #define | SERVO_MAX_ANGLE 180 |
| The maximum angle of the servo. | |
| #define | SERVO_MIN_WIDTH 204 |
| The 1ms pulse width for zero degrees (0 - 4095). | |
| #define | SERVO_MAX_WIDTH 410 |
| The 2ms pulse width for 180 degrees (0 - 4095). | |
| #define | SERVO_TIMER1_TOP 20000 |
| The top value for XLAT and BLANK pulses. | |
| #define | SERVO_TIMER2_TOP 77 |
| The top value for GSCLK pulses. | |
Functions | |
| void | tlc_initServos (uint8_t initAngle) |
| Initializes the tlc. | |
| void | tlc_setServo (TLC_CHANNEL_TYPE channel, uint8_t angle) |
| Sets a servo on channel to angle. | |
| uint8_t | tlc_getServo (TLC_CHANNEL_TYPE channel) |
| Gets the current angle that channel is set to. | |
| uint16_t | tlc_angleToVal (uint8_t angle) |
| Converts and angle (0 - SERVO_MAX_ANGLE) to the inverted tlc channel value (4095 - 0). | |
| uint8_t | tlc_valToAngle (uint16_t value) |
| Converts an inverted tlc channel value (4095 - 0) into an angle (0 - SERVO_MAX_ANGLE). | |
| #define SERVO_MAX_ANGLE 180 |
The maximum angle of the servo.
| #define SERVO_MAX_WIDTH 410 |
The 2ms pulse width for 180 degrees (0 - 4095).
| #define SERVO_MIN_WIDTH 204 |
The 1ms pulse width for zero degrees (0 - 4095).
| #define SERVO_TIMER1_TOP 20000 |
The top value for XLAT and BLANK pulses.
This is with the div8 prescale, so
The default is 20000, which corresponds to 50Hz.
| #define SERVO_TIMER2_TOP 77 |
The top value for GSCLK pulses.
Related to SERVO_TIMER1_TOP by
The default is 77.
1.5.6