Interface to PWM motor controller.
More...
#include "timer.h"
#include <avr/io.h>
#include <stdint.h>
Go to the source code of this file.
Macros |
#define | LEFT_MOTOR 0 |
#define | RIGHT_MOTOR 1 |
#define | BOTH_MOTORS 2 |
#define | LEFT_ENC 1 |
#define | RIGHT_ENC 0 |
#define | MAX_BRAKE 255 |
#define | MC_PORT PORTA |
#define | FORWARD_LEFT 7 |
#define | FORWARD_RIGHT 5 |
#define | REVERSE_LEFT 6 |
#define | REVERSE_RIGHT 4 |
#define | PWM_LEFT timer1PWMASet |
#define | PWM_RIGHT timer1PWMBSet |
Functions |
void | moveStraight (int16_t ticks, uint8_t speed) |
void | tractorTurn (uint8_t speed, int8_t brads) |
void | tankTurn (uint8_t speed, int8_t brads) |
void | enableMotors (void) |
void | disableMotors (void) |
void | forward (uint8_t motorSelect, uint8_t speed) |
void | reverse (uint8_t motorSelect, uint8_t speed) |
void | neutral (void) |
void | brake (uint8_t motorSelect) |
void | tickWheels (int16_t leftTicks, int16_t rightTicks, uint8_t speed) |
Detailed Description
Interface to PWM motor controller.
- Author
- Mike Shelley
Pinout: 2,3 Left motor control 6,7 Right motor control 5,4 motor enable, PWM outputs 5 - A, Right 4 - B, Left
- Note
- : Assumes motor enable is connected to PWM A,B defined in timer.h
Definition in file motor_control.h.