1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-07-01 07:15:24 +02:00
cdf2018-principal/chef/src/testSlow.c

49 lines
828 B
C
Raw Normal View History

2018-05-06 01:14:09 +02:00
/* 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"
2018-05-06 08:14:51 +02:00
#include "motor.h"
2018-05-06 01:14:09 +02:00
#include "buttons.h"
#define VIT 0.40
2018-05-06 08:14:51 +02:00
void setPWMTensionWrapper(float l, float r) {
2018-05-06 01:14:09 +02:00
/* clearLCD(); */
printfToLCD(LCD_LINE_1, "L: %f", l);
printfToLCD(LCD_LINE_2, "R: %f", r);
2018-05-06 08:14:51 +02:00
setPWMTension(l, r);
2018-05-06 01:14:09 +02:00
}
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
wiringPiSetup();
initI2C();
initLCD();
configureCF();
configureButtons();
configureMovement();
2018-05-06 08:14:51 +02:00
setPWMTensionWrapper(VIT, VIT);
2018-05-06 01:14:09 +02:00
for (;;) {
2018-05-06 08:14:51 +02:00
setPWMTensionWrapper(VIT, VIT);
2018-05-06 01:14:09 +02:00
pressedButton(BUT_BLOCK);
brake();
pressedButton(BUT_BLOCK);
}
}