![]() |
Smart Car Controller
1.0
LIbrary to manage a Smart Car Robot
|
Header file for SmartCar library hardware related definitions. More...
Macros | |
#define | NO_PIN 255 |
Pin number when pin is not defined. | |
#define | CONTROLLER_L298 1 |
Configure L298N as the motor controller. | |
#define | CONTROLLER_L293 0 |
Configure L293 as the motor controller. | |
#define | CONTROLLER_M1508 0 |
Configure M1508 as the motor controller. | |
#define | CONTROLLER_DRV8833 0 |
Configure DRV8833 as the motor controller. | |
Variables | |
const uint8_t | MC_INA1_PIN = 8 |
Motor A Mode pin 1 - simple digital pin. | |
const uint8_t | MC_INA2_PIN = 7 |
Motor A Mode pin 2 - simple digital pin. | |
const uint8_t | MC_ENA_PIN = 9 |
Motor A output enable - PWM capable pin. | |
const uint8_t | MC_INB1_PIN = 5 |
Motor B Mode pin 1 - simple digital pin. | |
const uint8_t | MC_INB2_PIN = 4 |
Motor B Mode pin 2 - simple digital pin. | |
const uint8_t | MC_ENB_PIN = 6 |
Motor B output enable - PWM capable pin. | |
const uint8_t | EN_L_PIN = 3 |
Left Motor encoder interrupt pin. | |
const uint8_t | EN_R_PIN = 2 |
Right Motor encoder interrupt pin. | |
const uint8_t | PULSE_PER_REV = 40 |
Encoder pulses per wheel revolution. | |
const uint8_t | WHEEL_CIRCUM = 200 |
Wheel circumference ( = distance travelled per rev) in mm. | |
const float | DefKp = 0.9 |
PID proportional weighting default. | |
const float | DefKi = 0.9 |
PID integral weighting default. | |
const float | DefKd = 0.1 |
PID derivative weighting default. | |
const uint32_t | PID_PERIOD = 500 |
PID calculation period in ms. | |
const uint32_t | MS_PER_SEC = 1000 |
number of ms in 1 second | |
const uint16_t | PID_FREQ = (MS_PER_SEC / PID_PERIOD) |
whole number is better | |
const uint8_t | PWM_MIN = 40 |
Minimum PWM that will turn the motor. | |
const uint8_t | PWM_MAX = 255 |
Maximum PWM. | |
const uint8_t | PWM_CREEP = 120 |
Creep speed PWM default value. | |
const uint16_t | EEPROM_ADDR = 1023 |
EEPROM config data ENDS at this address (ie saved below addr) | |
const uint8_t | SIG [2] = { 0xaa, 0x33 } |
EEPROM config signature bytes. | |
Header file for SmartCar library hardware related definitions.