24 #ifndef _LIGHTWEIGHT_SERVO_H
25 #define _LIGHTWEIGHT_SERVO_H
27 #if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
29 #define VERSION_LIGHTWEIGHT_SERVO "1.1.0"
30 #define VERSION_LIGHTWEIGHT_SERVO_MAJOR 1
31 #define VERSION_LIGHTWEIGHT_SERVO_MINOR 1
39 #define ISR1_COUNT_FOR_20_MILLIS 40000 // you can modify this if you have servos which accept a higher rate
45 void initLightweightServoPin9And10();
46 void initLightweightServoPin9();
47 void initLightweightServoPin10();
48 void initLightweightServoPin9_10(
bool aUsePin9,
bool aUsePin10);
49 void deinitLightweightServoPin9_10(
bool aUsePin9,
bool aUsePin10);
51 void setLightweightServoPulseMicrosFor0And180Degree(
int aMicrosecondsForServo0Degree,
int a180DegreeValue);
52 void setLightweightServoRefreshRate(
unsigned int aRefreshPeriodMicroseconds);
54 int writeLightweightServo(
int aDegree,
bool aUsePin9,
bool aUpdateFast =
false);
55 void writeMicrosecondsLightweightServo(
int aMicroseconds,
bool aUsePin9,
bool aUpdateFast =
false);
57 void write9(
int aDegree,
bool aUpdateFast =
false);
58 void writeMicroseconds9(
int aMicroseconds,
bool aUpdateFast =
false);
59 void writeMicroseconds9Direct(
int aMicroseconds);
61 void write10(
int aDegree,
bool aUpdateFast =
false);
62 void writeMicroseconds10(
int aMicroseconds,
bool aUpdateFast =
false);
63 void writeMicroseconds10Direct(
int aMicroseconds);
66 int DegreeToMicrosecondsLightweightServo(
int aDegree);
67 int MicrosecondsToDegreeLightweightServo(
int aMicroseconds);
69 #endif // AVR_ATmega328
76 #endif // _LIGHTWEIGHT_SERVO_H