143 if ( angleArg < 0) angleArg = 0;
144 if ( angleArg > 180) angleArg = 180;
154 uint8_t count = 0, i = 0;
157 static unsigned long lastRefresh = 0;
158 unsigned long m = millis();
161 if ( m >= lastRefresh && m < lastRefresh + 20)
return;
165 if ( count == 0)
return;
174 for ( i = 1; i < count; i++) {
191 TCCR1B &= ~(1 << CS10);
193 for ( i = 0; i < count; i++) digitalWrite( s[i]->
pin, 1);
195 uint8_t start = TCNT0;
200 for ( i = 0; i < count; i++) {
201 uint16_t go = start + s[i]->
pulse;
207 if ( now < last) base += 256;
210 if(base + now >= go - 16)
215 if ( base+now > go) {
216 digitalWrite( s[i]->
pin,0);
222 TCCR1B |= (1 << CS10);
void detach()
Detaches the servo motor from the uStepper.
void setMaximumPulse(uint16_t t)
Sets the maximum pulse.
uint8_t attach(int pinArg)
Attaches the servo motor to a specific pin.
class uStepperServo * next
Prototype of class for ustepper servo.
static void refresh()
Updates servo output pins.
uStepperServo()
Constructor for servo class.
Function prototypes and definitions for the uStepper Servo library.
void write(int angleArg)
Specify angle of servo motor.
void setMinimumPulse(uint16_t t)
Sets the minimum pulse.
static uStepperServo * first