#include "stm32f10x.h"
#include "gpio.h"
#include "servo.h"
#include "motoreducteur.h"
#include "rtc.h"
#include "remote.h"
#include "accelerometer.h"


void initImplementation(void);

float GX, GY, GZ;
int main (void)
{

	//MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp};	//led
	//MyGPIO_Init(&led);																//test des leds pour ignorer les contraintes li�es aux diff�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);
	};	
}

void initImplementation(void)
{
	MyServo_Init();
	MyServo_ChangeAngle(179);
	initRemote();
	Init_accelerometre();
	testRemote();
	MyMotor_Init();
	MyMotor_ChangeSpeed(0);
	MyMotor_ChangeDirection(HORAIRE);
	MyRTC_Init();
}
