2018-04-30 22:40:20 +02:00
|
|
|
/* Teste si une broche est connecté à une autre */
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
2018-05-01 08:45:02 +02:00
|
|
|
#include <wiringPi.h>
|
2018-04-30 22:40:20 +02:00
|
|
|
#include <wiringPiI2C.h>
|
|
|
|
|
|
|
|
#include "lcd.h"
|
2018-05-01 08:45:02 +02:00
|
|
|
#include "CF.h"
|
2018-04-30 22:40:20 +02:00
|
|
|
#include "movement.h"
|
2018-05-01 08:45:02 +02:00
|
|
|
#include "buttons.h"
|
2018-04-30 22:40:20 +02:00
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
|
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
|
|
|
|
2018-05-01 08:45:02 +02:00
|
|
|
wiringPiSetup();
|
2018-04-30 22:40:20 +02:00
|
|
|
|
2018-05-01 08:45:02 +02:00
|
|
|
initI2C();
|
2018-04-30 22:40:20 +02:00
|
|
|
initLCD();
|
2018-05-01 08:45:02 +02:00
|
|
|
configureCF();
|
|
|
|
configureButtons();
|
2018-04-30 22:40:20 +02:00
|
|
|
configureMovement();
|
|
|
|
|
|
|
|
for (;;) {
|
2018-05-01 08:45:02 +02:00
|
|
|
clearLCD();
|
|
|
|
printToLCD(LCD_LINE_1, "Forward");
|
|
|
|
changerMoteurs(3.3, 3.3);
|
|
|
|
pressedButton(BUT_BLOCK);
|
|
|
|
|
|
|
|
clearLCD();
|
|
|
|
printToLCD(LCD_LINE_1, "Right");
|
|
|
|
changerMoteurs(-3.3, 3.3);
|
|
|
|
pressedButton(BUT_BLOCK);
|
|
|
|
|
|
|
|
clearLCD();
|
|
|
|
printToLCD(LCD_LINE_1, "Left");
|
|
|
|
changerMoteurs(-3.3, -3.3);
|
|
|
|
pressedButton(BUT_BLOCK);
|
|
|
|
|
|
|
|
clearLCD();
|
|
|
|
printToLCD(LCD_LINE_1, "Backward");
|
|
|
|
changerMoteurs(3.3, -3.3);
|
|
|
|
pressedButton(BUT_BLOCK);
|
|
|
|
|
|
|
|
clearLCD();
|
|
|
|
printToLCD(LCD_LINE_1, "Brake");
|
|
|
|
brake();
|
|
|
|
pressedButton(BUT_BLOCK);
|
|
|
|
|
|
|
|
clearLCD();
|
|
|
|
printToLCD(LCD_LINE_1, "Free");
|
|
|
|
freewheel();
|
|
|
|
pressedButton(BUT_BLOCK);
|
2018-04-30 22:40:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|