2018-09-25 02:41:58 +00:00
|
|
|
#include <avr/interrupt.h>
|
|
|
|
#include "queue.h"
|
|
|
|
#include "pinio.h"
|
|
|
|
#include "serial.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#ifdef INVERT_DIRECTION_ENCODER
|
|
|
|
#define direction_encoder() (READ(ENCODER_PIN_B)?1:0)
|
|
|
|
#else
|
|
|
|
#define direction_encoder() (READ(ENCODER_PIN_B)?0:1)
|
|
|
|
#endif
|
|
|
|
|
2018-10-13 20:19:06 +00:00
|
|
|
extern int16_t desired_speed;
|
2018-10-23 02:11:23 +00:00
|
|
|
extern int16_t margin_max_speed;
|
2018-11-30 19:03:21 +00:00
|
|
|
extern int32_t kp, ki;
|
2018-10-30 17:36:17 +00:00
|
|
|
void stop_dc_motor(uint8_t);
|
2018-10-13 20:19:06 +00:00
|
|
|
|
2018-09-25 02:41:58 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
void sensing_init();
|
2018-10-13 20:19:06 +00:00
|
|
|
void update_dc_motor();
|
2018-10-23 02:11:23 +00:00
|
|
|
void set_dc_motor_speed_margin(int16_t);
|
2018-09-25 02:41:58 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|