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

48 lines
799 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"
2018-05-06 12:50:03 +02:00
#define VIT 1
#define VITL VIT
2018-05-06 18:35:26 +02:00
#define VITR VIT
2018-05-06 01:14:09 +02:00
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();
for (;;) {
2018-05-06 12:50:03 +02:00
setPWMTensionWrapper(VITL, VITR);
2018-05-06 01:14:09 +02:00
pressedButton(BUT_BLOCK);
brake();
pressedButton(BUT_BLOCK);
}
}