voilier-team-1/keilproject/Source/Principale.c

46 lines
1,006 B
C
Raw Blame History

#include "stm32f10x.h"
#include "gpio.h"
#include "servo.h"
#include "motoreducteur.h"
#include "rtc.h"
#include "remote.h"
#include "accelerometer.h"
#include "battery.h"
#include "timer.h"
void initImplementation(void);
float GX, GY, GZ;
int Angle_Girouette=0;
int main (void)
{
//MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
//MyGPIO_Init(&led); //test des leds pour ignorer les contraintes li<6C>es aux diff<66>rents ports
initImplementation();
MyServo_ChangeAngle(90);
//MyRTC_GetTime(&sec, &min, &hour, &day, &date, &month, &year);
while(1){
Lecture_accelerometre(&GX,&GY,&GZ);
if(GZ < 5.5)
MyServo_ChangeAngle(179);
Angle_Girouette=MyGirouette_Angle(TIM4);
};
}
void initImplementation(void)
{
MyServo_Init();
MyServo_ChangeAngle(179);
initRemote();
Init_accelerometre();
MyGirouette_Init(TIM4);
MyGirouette_Init_IT_Z(0);
testRemote();
MyMotor_Init();
MyMotor_ChangeSpeed(0);
MyMotor_ChangeDirection(HORAIRE);
MyRTC_Init();
initBattery();
}