Arduino {code}racer API
... better know the details.
|
Functions | |
void | CodeRacer::servo_settings (uint8_t pos_center, uint8_t pos_left, uint8_t pos_right, uint8_t sweep_left_pos, uint8_t sweep_right_pos) |
Overwrites the default settings taken from header file by the parameters given to this method. More... | |
void | CodeRacer::servo_sweep () |
Turns sweeping of the servo from left to right and back on. More... | |
void | CodeRacer::servo_set_to_right () |
Drives the servo to the postion that is defined by #servo_right_pos. More... | |
void | CodeRacer::servo_set_to_left () |
Drives the servo to the postion that is defined by #servo_left_pos. More... | |
void | CodeRacer::servo_set_to_center () |
Drives the servo to the postion that is defined by #servo_center_pos. More... | |
uint8_t | CodeRacer::servo_set_position_wait (uint8_t position) |
Drive the servo to the postion given to this method. More... | |
unsigned long | CodeRacer::servo_set_position (uint8_t position) |
Drive the servo to the postion given to this method. More... | |
void CodeRacer::servo_settings | ( | uint8_t | pos_center, |
uint8_t | pos_left, | ||
uint8_t | pos_right, | ||
uint8_t | sweep_left_pos, | ||
uint8_t | sweep_right_pos | ||
) |
Overwrites the default settings taken from header file by the parameters given to this method.
pos_center | The postion at which the servo moves to straight forward. Default is 90. Allowed 10 <= pos_center <= 170. |
pos_left | The postion at which the servo moves to the left. Default is 170. Allowed 10 <= pos_center <= 170. |
pos_right | The postion at which the servo moves to the right. Default is 10. Allowed 10 <= pos_center <= 170. |
sweep_left_pos | If the servo is sweeping from left to the right - this defines the most left postion. Default is 140. Allowed 10 <= pos_center <= 170. |
sweep_right_pos | If the servo is sweeping from left to the right - this defines the most right postion. Default is 40. Allowed 10 <= pos_center <= 170. |
Definition at line 510 of file CodeRacer.cpp.
void CodeRacer::servo_sweep | ( | ) |
Turns sweeping of the servo from left to right and back on.
The sweeping range is defind by #servo_sweep_left_pos and #servo_sweep_right_pos attributes. Both can be set by either servo_settings() or as public members. Every time servo_sweep() is called the servo is driven by 5 steps until either #servo_sweep_left_pos or #servo_sweep_right_pos is reached. Then it will turn the direction and step to the other side every time this method is called.
Definition at line 526 of file CodeRacer.cpp.
void CodeRacer::servo_set_to_right | ( | ) |
Drives the servo to the postion that is defined by #servo_right_pos.
Definition at line 548 of file CodeRacer.cpp.
void CodeRacer::servo_set_to_left | ( | ) |
Drives the servo to the postion that is defined by #servo_left_pos.
Definition at line 556 of file CodeRacer.cpp.
void CodeRacer::servo_set_to_center | ( | ) |
Drives the servo to the postion that is defined by #servo_center_pos.
Definition at line 564 of file CodeRacer.cpp.
uint8_t CodeRacer::servo_set_position_wait | ( | uint8_t | position | ) |
Drive the servo to the postion given to this method.
The method will wait until the servo has reached its new position.
position | Position the servo will be drived to. Allowed are values 10<=postion<=170. 10 is at the right hand side, 170 at the left hand side. |
Definition at line 575 of file CodeRacer.cpp.
unsigned long CodeRacer::servo_set_position | ( | uint8_t | position | ) |
Drive the servo to the postion given to this method.
The method will not wait until the servo has reached its new position.
position | Position the servo will be drived to. Allowed are values 10<=postion<=170. 10 is at the right hand side, 170 at the left hand side. |
Definition at line 589 of file CodeRacer.cpp.