1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-05-21 22:26:13 +02:00
cdf2018-principal/chef/src/movement.h
2018-04-30 16:15:47 +02:00

53 lines
775 B
C

/*
* Fonctions de déplacment du robot
*/
#ifndef __MOVEMENT_H_
#define __MOVEMENT_H_
#include "position.h"
#include <wiringPi.h>
#define PWM_MAX 1023
#define PWM_MAX_V 3.3
// #define TESTINATOR
#define TLE5206
#ifdef TESTINATOR
#define MOT_MIN_V 0.1
#define MOT_MAX_V 2.0
#endif
#ifdef TLE5206
#define MOT_MIN_V 0.1
#define MOT_MAX_V 2.5
#endif
// Pins definition
// Left
// Physical 32
#define ENA 26
#define IN1 2
#define IN2 3
// Physical 33
// Right
#define ENB 23
#define IN3 4
#define IN4 5
void configureMovement();
void aller(struct position* pos);
int changerMoteurs(float vitL, float vitR);
// Vitesse en mm/s
// Vitesse < 0 ⇒ sens inverse
// Si vitesse < seuil ⇒ brake
int brake();
int stop();
int freewheel();
void deconfigureMovement();
#endif