mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-07-01 07:15:24 +02:00
49 lines
835 B
C
49 lines
835 B
C
|
/* Teste si une broche est connecté à une autre */
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <unistd.h>
|
||
|
#include <wiringPi.h>
|
||
|
#include <wiringPiI2C.h>
|
||
|
|
||
|
#include "lcd.h"
|
||
|
#include "CF.h"
|
||
|
#include "movement.h"
|
||
|
#include "buttons.h"
|
||
|
|
||
|
#define VIT 0.40
|
||
|
|
||
|
|
||
|
void changerMoteursWrapper(float l, float r) {
|
||
|
/* clearLCD(); */
|
||
|
printfToLCD(LCD_LINE_1, "L: %f", l);
|
||
|
printfToLCD(LCD_LINE_2, "R: %f", r);
|
||
|
changerMoteurs(l, r);
|
||
|
}
|
||
|
|
||
|
int main(int argc, char* argv[])
|
||
|
{
|
||
|
|
||
|
(void)argc;
|
||
|
(void)argv;
|
||
|
|
||
|
wiringPiSetup();
|
||
|
|
||
|
initI2C();
|
||
|
initLCD();
|
||
|
configureCF();
|
||
|
configureButtons();
|
||
|
configureMovement();
|
||
|
|
||
|
changerMoteursWrapper(VIT, VIT);
|
||
|
|
||
|
for (;;) {
|
||
|
changerMoteursWrapper(VIT, VIT);
|
||
|
pressedButton(BUT_BLOCK);
|
||
|
brake();
|
||
|
pressedButton(BUT_BLOCK);
|
||
|
}
|
||
|
|
||
|
}
|