1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-05-18 13:06:00 +02:00
cdf2018-principal/chef/src/testForward.c

64 lines
1.2 KiB
C
Raw Normal View History

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
2018-05-02 05:51:14 +02:00
#define PATATE 3.3/2
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");
2018-05-02 05:51:14 +02:00
changerMoteurs(PATATE, PATATE);
2018-05-01 08:45:02 +02:00
pressedButton(BUT_BLOCK);
clearLCD();
printToLCD(LCD_LINE_1, "Right");
2018-05-02 05:51:14 +02:00
changerMoteurs(-PATATE, PATATE);
2018-05-01 08:45:02 +02:00
pressedButton(BUT_BLOCK);
clearLCD();
printToLCD(LCD_LINE_1, "Left");
2018-05-02 05:51:14 +02:00
changerMoteurs(-PATATE, -PATATE);
2018-05-01 08:45:02 +02:00
pressedButton(BUT_BLOCK);
clearLCD();
printToLCD(LCD_LINE_1, "Backward");
2018-05-02 05:51:14 +02:00
changerMoteurs(PATATE, -PATATE);
2018-05-01 08:45:02 +02:00
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
}
}