40 volatile T current_value;
60 current_value += step_size;
85 void set(T targetvalue, T num_steps)
88 T numerator = targetvalue-current_value;
89 step_size= numerator/num_steps;
92 current_value = targetvalue;
102 void set(T startvalue, T targetvalue, T num_steps)
105 set(targetvalue, num_steps);
115 volatile unsigned char current_value;
135 current_value += step_size;
136 return current_value;
147 void set(
unsigned char value)
159 void set(
unsigned char targetvalue,
unsigned char num_steps)
161 step_size=(
char)((((
float)targetvalue-current_value)/num_steps));
170 void set(
unsigned char startvalue,
unsigned char targetvalue,
unsigned char num_steps)
173 set(targetvalue
, num_steps
);
184 volatile unsigned int current_value;
204 current_value += step_size;
205 return current_value;
216 void set(
unsigned int value)
228 void set(
unsigned int targetvalue,
unsigned int num_steps)
230 step_size=(
int)((((
float)targetvalue-current_value)/num_steps));
240 void set(
unsigned int startvalue,
unsigned int targetvalue,
unsigned int num_steps)
243 set(targetvalue
, num_steps
);
256 volatile unsigned long current_value;
276 current_value += step_size;
277 return current_value;
288 void set(
unsigned long value)
300 void set(
unsigned long targetvalue,
unsigned long num_steps)
302 step_size=(
long)((((
float)targetvalue-current_value)/num_steps));
311 void set(
unsigned long startvalue,
unsigned long targetvalue,
unsigned long num_steps)
314 set(targetvalue
, num_steps
);
void set(T value)
Set the current value of the line.
void set(unsigned int targetvalue, unsigned int num_steps)
Given a target value and the number of steps to take on the way, this calculates the step size needed...
void set(unsigned long value)
Set the current value of the line.
void set(unsigned long targetvalue, unsigned long num_steps)
Given a target value and the number of steps to take on the way, this calculates the step size needed...
unsigned char next()
Increments one step along the line.
void set(unsigned int value)
Set the current value of the line.
void set(unsigned char value)
Set the current value of the line.
void set(T startvalue, T targetvalue, T num_steps)
Given a new starting value, target value and the number of steps to take on the way, this sets the step size needed to get there.
For linear changes with a minimum of calculation at each step.
void set(unsigned char startvalue, unsigned char targetvalue, unsigned char num_steps)
Given a new starting value, target value and the number of steps to take on the way, this sets the step size needed to get there.
void set(T targetvalue, T num_steps)
Given a target value and the number of steps to take on the way, this calculates the step size needed...
void set(unsigned long startvalue, unsigned long targetvalue, unsigned long num_steps)
Given a new starting value, target value and the number of steps to take on the way, this sets the step size needed to get there.
void set(unsigned int startvalue, unsigned int targetvalue, unsigned int num_steps)
Given a new starting value, target value and the number of steps to take on the way, this sets the step size needed to get there.
unsigned long next()
Increments one step along the line.
unsigned int next()
Increments one step along the line.
void set(unsigned char targetvalue, unsigned char num_steps)
Given a target value and the number of steps to take on the way, this calculates the step size needed...
T next()
Increments one step along the line.