1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-06-29 14:39:01 +02:00
cdf2018-principal/chef/src/movement.h

51 lines
749 B
C
Raw Normal View History

2018-04-04 16:17:13 +02:00
/*
* Fonctions de déplacment du robot
*/
2018-04-04 16:17:13 +02:00
#ifndef __MOVEMENT_H_
#define __MOVEMENT_H_
2018-04-04 16:17:13 +02:00
#include "position.h"
#include <wiringPi.h>
#define PWM_MAX 1023
#define PWM_MAX_V 3.3
2018-04-30 16:15:47 +02:00
2018-04-30 22:40:20 +02:00
#define TESTINATOR
// #define TLE5206
2018-04-30 16:15:47 +02:00
#ifdef TESTINATOR
2018-04-04 16:17:13 +02:00
#define MOT_MIN_V 0.1
#define MOT_MAX_V 2.0
2018-04-30 16:15:47 +02:00
#endif
#ifdef TLE5206
#define MOT_MIN_V 0.1
#define MOT_MAX_V 2.5
#endif
2018-04-04 16:17:13 +02:00
// Pins definition
2018-04-30 16:15:47 +02:00
// Left
2018-04-04 16:17:13 +02:00
#define ENA 26
2018-04-30 22:40:20 +02:00
#define IN1 21
#define IN2 22
2018-04-04 16:17:13 +02:00
2018-04-30 16:15:47 +02:00
// Right
2018-04-04 16:17:13 +02:00
#define ENB 23
2018-04-30 22:40:20 +02:00
#define IN3 24
#define IN4 25
2018-04-04 16:17:13 +02:00
void configureMovement();
void aller(struct position* pos);
int changerMoteurs(float vitL, float vitR);
2018-03-26 10:07:21 +02:00
// Vitesse en mm/s
// Vitesse < 0 ⇒ sens inverse
// Si vitesse < seuil ⇒ brake
int brake();
2018-04-04 16:17:13 +02:00
int stop();
2018-03-26 10:07:21 +02:00
int freewheel();
2018-04-04 16:17:13 +02:00
void deconfigureMovement();
#endif