Elisa3
motors.c File Reference
#include "motors.h"

Functions

void initMotors ()
 Configure the timer3 and timer4 registers to work at about 122 Hz.
signed int cast_speed (signed int vel)
void handleMotorsWithNoController ()
 Change the motors speed (pwm registers) accordingly to the obstacle avoidance (if enabled) and speed controller. In this function both the motors velocities measurements are also updated.
void handleMotorsWithSpeedController ()
 Change the motors speed (pwm registers) accordingly to the obstacle avoidance (if enabled). In this function both the motors velocities measurements are also updated (even if not needed).
void setLeftSpeed (signed char vel)
 Set the desired speed for the left motor.
void setRightSpeed (signed char vel)
 Set the desired speed for the right motor.
void handleCalibration ()
void updateOdomData ()
signed int getInputFromSpeed (signed int s, unsigned char mode)
void getRightSpeedFromInput ()
void getLeftSpeedFromInput ()
void writeDefaultCalibration ()
void initCalibration ()
 ISR (TIMER4_OVF_vect)
 ISR (TIMER4_COMPA_vect)
 ISR (TIMER4_COMPB_vect)
 ISR (TIMER3_OVF_vect)
 ISR (TIMER3_COMPA_vect)
 ISR (TIMER3_COMPB_vect)

Function Documentation

signed int cast_speed ( signed int  vel)
signed int getInputFromSpeed ( signed int  s,
unsigned char  mode 
)

Change the motors speed (pwm registers) accordingly to the obstacle avoidance (if enabled) and speed controller. In this function both the motors velocities measurements are also updated.

Returns:
none

Change the motors speed (pwm registers) accordingly to the obstacle avoidance (if enabled). In this function both the motors velocities measurements are also updated (even if not needed).

Returns:
none
void initCalibration ( )
void initMotors ( )

Configure the timer3 and timer4 registers to work at about 122 Hz.

Returns:
none
ISR ( TIMER4_OVF_vect  )
ISR ( TIMER4_COMPA_vect  )
ISR ( TIMER4_COMPB_vect  )
ISR ( TIMER3_OVF_vect  )
ISR ( TIMER3_COMPA_vect  )
ISR ( TIMER3_COMPB_vect  )
void setLeftSpeed ( signed char  vel)

Set the desired speed for the left motor.

Parameters:
veldesired velocity to set (from -100 to 100)
Returns:
none
void setRightSpeed ( signed char  vel)

Set the desired speed for the right motor.

Parameters:
veldesired velocity to set (from -100 to 100)
Returns:
none
void updateOdomData ( )
 All Files Functions Variables Defines