#include <stdlib.h>
#include "e_epuck_ports.h"
#include "e_init_port.h"
Functions | |
| void | __attribute__ ((interrupt, auto_psv, shadow)) |
| int | e_get_steps_left (void) |
| Give the number of left motor steps. | |
| void | e_set_steps_left (int set_steps) |
| Set the number of left motor steps. | |
| int | e_get_steps_right (void) |
| Give the number of right motor steps. | |
| void | e_set_steps_right (int set_steps) |
| Set the number of right motor steps. | |
| void | e_set_speed_left (int motor_speed) |
| Manage the left speed. | |
| void | e_set_speed_right (int motor_speed) |
| Manage the right speed. | |
| void | e_init_motors (void) |
| Initialize the motors's ports. | |
Variables | |
| static int | left_speed = 0 |
| static int | right_speed = 0 |
| static int | nbr_pas_left = 0 |
| static int | nbr_pas_right = 0 |
| static int | motor_counter_left = 0 |
| static int | motor_counter_right = 0 |
| static int | motor_counter_left_init = 0 |
| static int | motor_counter_right_init = 0 |
Manage the motors (with timer3).
This module manage the two motors with one timer: timer3.
| void __attribute__ | ( | (interrupt, auto_psv, shadow) | ) |
| int e_get_steps_left | ( | void | ) |
Give the number of left motor steps.
| int e_get_steps_right | ( | void | ) |
Give the number of right motor steps.
| void e_init_motors | ( | void | ) |
Initialize the motors's ports.
Initialize the motors's agendas.
This function configure timer3 and initialize the ports used by the motors. In fact it call "the e_init_port()" function.
| void e_set_speed_left | ( | int | motor_speed | ) |
Manage the left speed.
Manage the left motor speed.
This function manage the left motor speed by changing the MOTOR1 phases. The changing phases frequency (=> speed) is controled by the timer3.
| motor_speed | from -1000 to 1000 give the motor speed in steps/s, positive value to go forward and negative to go backward. |
| void e_set_speed_right | ( | int | motor_speed | ) |
Manage the right speed.
Manage the right motor speed.
This function manage the right motor speed by changing the MOTOR2 phases. The changing phases frequency (=> speed) is controled by the timer3.
| motor_speed | from -1000 to 1000 give the motor speed in steps/s, positive value to go forward and negative to go backward. |
| void e_set_steps_left | ( | int | set_steps | ) |
Set the number of left motor steps.
| set_steps | The number of changed phases that you want set. |
| void e_set_steps_right | ( | int | set_steps | ) |
Set the number of right motor steps.
| set_steps | The number of changed phases that you want set. |
int left_speed = 0 [static] |
int motor_counter_left = 0 [static] |
int motor_counter_left_init = 0 [static] |
int motor_counter_right = 0 [static] |
int motor_counter_right_init = 0 [static] |
int nbr_pas_left = 0 [static] |
int nbr_pas_right = 0 [static] |
int right_speed = 0 [static] |
1.5.4