diff --git a/implementation/remote.c b/implementation/remote.c index f5394ac..5d16ae1 100644 --- a/implementation/remote.c +++ b/implementation/remote.c @@ -1,5 +1,6 @@ #include "remote.h" #include "gpio.h" +#include "motoreducteur.h" MyUART_Struct_Typedef uartCool = {USART1,9600,lengthBit8,parityNone,stopBit1}; @@ -7,12 +8,14 @@ void remote(uint8_t data) { MyUART_Send(&uartCool,data); int8_t signedData = (int8_t)data; - if(signedData > 0) + if(signedData >= 0) { - MyGPIO_Set(GPIOA,5); + MyMotor_ChangeDirection(HORAIRE); + MyMotor_ChangeSpeed(signedData*100); } else { - MyGPIO_Reset(GPIOA,5); + MyMotor_ChangeDirection(ANTIHOR); + MyMotor_ChangeSpeed((-signedData)*100); } } diff --git a/keilproject/Source/Principale.c b/keilproject/Source/Principale.c index 4737fad..f298a21 100644 --- a/keilproject/Source/Principale.c +++ b/keilproject/Source/Principale.c @@ -5,21 +5,25 @@ #include "rtc.h" #include "remote.h" +void initImplementation(void); + 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(); + //MyRTC_GetTime(&sec, &min, &hour, &day, &date, &month, &year); + while(1){}; +} + +void initImplementation(void) { MyServo_Init(); MyServo_ChangeAngle(179); - 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 - //MyMotor_Init(); - - //MyMotor_ChangeSpeed(2000); - //MyMotor_ChangeDirection(HORAIRE); initRemote(); testRemote(); - + MyMotor_Init(); + MyMotor_ChangeSpeed(0); + MyMotor_ChangeDirection(HORAIRE); MyRTC_Init(); -// MyRTC_GetTime(); - - while(1){}; } diff --git a/keilproject/voilier.uvoptx b/keilproject/voilier.uvoptx index a1e9b69..1daa6dd 100644 --- a/keilproject/voilier.uvoptx +++ b/keilproject/voilier.uvoptx @@ -75,7 +75,7 @@ 1 0 - 1 + 0 18 @@ -183,10 +183,10 @@ 12000000 - 0 + 1 1 - 1 - 0 + 0 + 1 0 @@ -228,14 +228,14 @@ 0 - 0 + 1 0 - 0 + 1 18 - 1 - 0 + 0 + 1 1 1 1 @@ -244,7 +244,7 @@ 1 1 1 - 0 + 1 1 1 1 @@ -258,7 +258,7 @@ 1 0 0 - -1 + 6 @@ -269,8 +269,20 @@ - + STLink\ST-LINKIII-KEIL_SWO.dll + + + 0 + ST-LINKIII-KEIL_SWO + -U066FFF504955857567155843 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)) + + 0 @@ -314,6 +326,13 @@ + + 1 + 0 + 0 + 2 + 10000000 + @@ -359,7 +378,7 @@ 2 3 1 - 1 + 0 0 0 ..\driver\gpio.c @@ -439,7 +458,7 @@ 3 9 1 - 1 + 0 0 0 ..\implementation\rtc.c diff --git a/keilproject/voilier.uvprojx b/keilproject/voilier.uvprojx index 5c95e4a..c74b758 100644 --- a/keilproject/voilier.uvprojx +++ b/keilproject/voilier.uvprojx @@ -581,11 +581,11 @@ 0 1 1 - -1 + 4096 1 BIN\UL2CM3.DLL - + "" ()