1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-05-17 04:26:00 +02:00
cdf2018-principal/chef/src/testSlow.c
2018-05-09 09:57:11 +02:00

49 lines
821 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 "motor.h"
#include "buttons.h"
#define VIT 1
#define VITL VIT
#define VITR VIT
void setPWMTensionWrapper(float l, float r) {
/* clearLCD(); */
printfToLCD(LCD_LINE_1, "L: %f", l);
printfToLCD(LCD_LINE_2, "R: %f", r);
setPWMTension(l, r);
}
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
wiringPiSetup();
initI2C();
initLCD();
configureCF();
configureButtons();
configureMotor();
for (;;) {
setPWMTensionWrapper(VITL, VITR);
pressedButton(BUT_BLOCK);
brake();
pressedButton(BUT_BLOCK);
}
}