2023-03-22 15:28:54 +01:00
|
|
|
|
#include "stm32f10x.h"
|
2023-04-07 13:53:08 +02:00
|
|
|
|
#include "gpio.h"
|
2023-04-04 14:36:29 +02:00
|
|
|
|
#include "servo.h"
|
|
|
|
|
#include "motoreducteur.h"
|
2023-04-05 08:25:25 +02:00
|
|
|
|
#include "rtc.h"
|
2023-04-07 13:53:08 +02:00
|
|
|
|
#include "remote.h"
|
2023-04-04 15:17:30 +02:00
|
|
|
|
#include "accelerometer.h"
|
2023-04-11 14:56:52 +02:00
|
|
|
|
#include "battery.h"
|
2023-04-11 15:26:48 +02:00
|
|
|
|
#include "timer.h"
|
2023-04-11 14:50:19 +02:00
|
|
|
|
|
2023-04-07 14:13:00 +02:00
|
|
|
|
void initImplementation(void);
|
|
|
|
|
|
2023-04-07 14:26:51 +02:00
|
|
|
|
float GX, GY, GZ;
|
2023-04-11 15:26:48 +02:00
|
|
|
|
int Angle_Girouette=0;
|
2023-03-22 15:28:54 +01:00
|
|
|
|
int main (void)
|
2023-04-07 14:13:00 +02:00
|
|
|
|
{
|
2023-04-11 14:21:35 +02:00
|
|
|
|
|
2023-04-07 14:13:00 +02:00
|
|
|
|
//MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
|
2023-04-11 14:21:35 +02:00
|
|
|
|
//MyGPIO_Init(&led); //test des leds pour ignorer les contraintes li<6C>es aux diff<66>rents ports
|
2023-04-07 14:13:00 +02:00
|
|
|
|
initImplementation();
|
2023-04-11 14:50:19 +02:00
|
|
|
|
MyServo_ChangeAngle(90);
|
2023-04-07 14:13:00 +02:00
|
|
|
|
//MyRTC_GetTime(&sec, &min, &hour, &day, &date, &month, &year);
|
2023-04-11 14:21:35 +02:00
|
|
|
|
while(1){
|
2023-04-07 14:26:51 +02:00
|
|
|
|
Lecture_accelerometre(&GX,&GY,&GZ);
|
2023-04-11 14:50:19 +02:00
|
|
|
|
if(GZ < 5.5)
|
|
|
|
|
MyServo_ChangeAngle(179);
|
2023-04-11 15:26:48 +02:00
|
|
|
|
Angle_Girouette=MyGirouette_Angle(TIM4);
|
2023-04-07 14:26:51 +02:00
|
|
|
|
};
|
2023-04-07 14:13:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initImplementation(void)
|
2023-03-22 15:28:54 +01:00
|
|
|
|
{
|
2023-04-04 14:36:29 +02:00
|
|
|
|
MyServo_Init();
|
|
|
|
|
MyServo_ChangeAngle(179);
|
2023-04-07 13:53:08 +02:00
|
|
|
|
initRemote();
|
2023-04-11 14:21:35 +02:00
|
|
|
|
Init_accelerometre();
|
2023-04-11 15:26:48 +02:00
|
|
|
|
MyGirouette_Init(TIM4);
|
|
|
|
|
MyGirouette_Init_IT_Z(0);
|
2023-04-07 13:53:08 +02:00
|
|
|
|
testRemote();
|
2023-04-07 14:13:00 +02:00
|
|
|
|
MyMotor_Init();
|
|
|
|
|
MyMotor_ChangeSpeed(0);
|
|
|
|
|
MyMotor_ChangeDirection(HORAIRE);
|
2023-04-05 08:25:25 +02:00
|
|
|
|
MyRTC_Init();
|
2023-04-07 15:28:30 +02:00
|
|
|
|
initBattery();
|
2023-04-04 14:36:29 +02:00
|
|
|
|
}
|
2023-04-04 16:39:20 +02:00
|
|
|
|
|