diff --git a/implementation/accelerometer.c b/implementation/accelerometer.c
index 2c8cf4e..d2b36d0 100644
--- a/implementation/accelerometer.c
+++ b/implementation/accelerometer.c
@@ -3,7 +3,7 @@
#include "MySPI.h"
#include "gpio.h"
-void Init_accelerometre()
+void Init_accelerometre(void)
{
//char testReg;
@@ -68,4 +68,4 @@ void Lecture_accelerometre(float* GX, float* GY, float* GZ)
*GZ = dataZ*0.004;//valeur du registre x pas accelerometre
MySPI_Set_NSS();//CS HIGH
-}
\ No newline at end of file
+}
diff --git a/implementation/accelerometer.h b/implementation/accelerometer.h
index f0926cc..77b42e0 100644
--- a/implementation/accelerometer.h
+++ b/implementation/accelerometer.h
@@ -2,7 +2,7 @@
#define INC_ACCELEROMETER_H_
#include "../driver/MySPI.h"
-void Init_accelerometre();
+void Init_accelerometre(void);
void Lecture_accelerometre(float *GX, float* GY, float* GZ);
-#endif
\ No newline at end of file
+#endif
diff --git a/keilproject/Source/Principale.c b/keilproject/Source/Principale.c
index 1310105..1b8a6c2 100644
--- a/keilproject/Source/Principale.c
+++ b/keilproject/Source/Principale.c
@@ -6,6 +6,7 @@
#include "remote.h"
#include "accelerometer.h"
+
void initImplementation(void);
float GX, GY, GZ;
@@ -15,9 +16,12 @@ 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);
};
}
@@ -32,5 +36,4 @@ void initImplementation(void)
MyMotor_ChangeSpeed(0);
MyMotor_ChangeDirection(HORAIRE);
MyRTC_Init();
- accelerometre();
}
diff --git a/keilproject/voilier.uvoptx b/keilproject/voilier.uvoptx
index 1daa6dd..aa1f2a2 100644
--- a/keilproject/voilier.uvoptx
+++ b/keilproject/voilier.uvoptx
@@ -26,9 +26,9 @@
0x4
ARM-ADS
- 12000000
+ 8000000
- 0
+ 1
1
0
1
@@ -79,8 +79,8 @@
18
- 0
- 1
+ 1
+ 0
1
1
1
@@ -117,6 +117,21 @@
BIN\UL2CM3.DLL
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGDARM
+ (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=429,109,850,536,0)(121=247,294,668,721,0)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=123,134,717,885,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+ -T0
+
0
UL2CM3
@@ -124,18 +139,30 @@
+
+
+ 0
+ 1
+ voyons
+
+
+ 1
+ 1
+ returnValue
+
+
0
0
- 0
- 0
+ 1
+ 1
0
0
0
0
- 0
+ 1
0
0
0
@@ -181,7 +208,7 @@
0x4
ARM-ADS
- 12000000
+ 8000000
1
1
@@ -272,10 +299,35 @@
STLink\ST-LINKIII-KEIL_SWO.dll
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
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)
+ -U066FFF504955857567155843 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8000 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGDARM
+ (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+ -T0
0
@@ -284,18 +336,35 @@
+
+
+ 0
+ 1
+ quelquechose
+
+
+ 1
+ 1
+ returnValue
+
+
+ 2
+ 1
+ GZ
+
+
0
0
- 0
- 0
+ 1
+ 1
0
0
0
0
- 0
+ 1
0
0
0
@@ -358,7 +427,7 @@
MesDrivers
- 1
+ 0
0
0
0
@@ -381,6 +450,18 @@
0
0
0
+ ..\driver\adc.c
+ adc.c
+ 0
+ 0
+
+
+ 2
+ 4
+ 1
+ 0
+ 0
+ 0
..\driver\gpio.c
gpio.c
0
@@ -388,7 +469,7 @@
2
- 4
+ 5
1
0
0
@@ -400,7 +481,7 @@
2
- 5
+ 6
1
0
0
@@ -412,39 +493,99 @@
2
- 6
- 1
+ 7
+ 5
0
0
0
- ..\driver\adc.c
- adc.c
+ ..\driver\adc.h
+ adc.h
+ 0
+ 0
+
+
+ 2
+ 8
+ 5
+ 0
+ 0
+ 0
+ ..\driver\gpio.h
+ gpio.h
+ 0
+ 0
+
+
+ 2
+ 9
+ 5
+ 0
+ 0
+ 0
+ ..\driver\MyI2C.h
+ MyI2C.h
+ 0
+ 0
+
+
+ 2
+ 10
+ 5
+ 0
+ 0
+ 0
+ ..\driver\MySPI.h
+ MySPI.h
+ 0
+ 0
+
+
+ 2
+ 11
+ 5
+ 0
+ 0
+ 0
+ ..\driver\timer.h
+ timer.h
+ 0
+ 0
+
+
+ 2
+ 12
+ 5
+ 0
+ 0
+ 0
+ ..\driver\uart.h
+ uart.h
0
0
- MesImplementations
+ New Group
1
0
0
0
3
- 7
+ 13
1
0
0
0
- ..\implementation\servo.c
- servo.c
+ ..\implementation\accelerometer.c
+ accelerometer.c
0
0
3
- 8
+ 14
1
0
0
@@ -456,7 +597,19 @@
3
- 9
+ 15
+ 1
+ 0
+ 0
+ 0
+ ..\implementation\remote.c
+ remote.c
+ 0
+ 0
+
+
+ 3
+ 16
1
0
0
@@ -468,13 +621,13 @@
3
- 10
+ 17
1
0
0
0
- ..\implementation\remote.c
- remote.c
+ ..\implementation\servo.c
+ servo.c
0
0
@@ -490,7 +643,7 @@
::Device
- 0
+ 1
0
0
1
diff --git a/keilproject/voilier.uvprojx b/keilproject/voilier.uvprojx
index c74b758..4976033 100644
--- a/keilproject/voilier.uvprojx
+++ b/keilproject/voilier.uvprojx
@@ -10,13 +10,13 @@
Simulé
0x4
ARM-ADS
- 5060960::V5.06 update 7 (build 960)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7
0
STM32F103RB
STMicroelectronics
- Keil.STM32F1xx_DFP.2.3.0
+ Keil.STM32F1xx_DFP.2.4.0
http://www.keil.com/pack/
IRAM(0x20000000,0x00005000) IROM(0x08000000,0x00020000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE
@@ -134,11 +134,11 @@
0
1
1
- -1
+ 4096
1
BIN\UL2CM3.DLL
-
+ "" ()
@@ -186,6 +186,7 @@
0
0
0
+ 0
0
0
8
@@ -313,7 +314,7 @@
1
- 1
+ 2
0
0
1
@@ -398,6 +399,11 @@
4
..\driver\Lib_Com_Periph_2022.lib
+
+ adc.c
+ 1
+ ..\driver\adc.c
+
gpio.c
1
@@ -414,34 +420,64 @@
..\driver\uart.c
- adc.c
- 1
- ..\driver\adc.c
+ adc.h
+ 5
+ ..\driver\adc.h
+
+
+ gpio.h
+ 5
+ ..\driver\gpio.h
+
+
+ MyI2C.h
+ 5
+ ..\driver\MyI2C.h
+
+
+ MySPI.h
+ 5
+ ..\driver\MySPI.h
+
+
+ timer.h
+ 5
+ ..\driver\timer.h
+
+
+ uart.h
+ 5
+ ..\driver\uart.h
- MesImplementations
+ New Group
- servo.c
+ accelerometer.c
1
- ..\implementation\servo.c
+ ..\implementation\accelerometer.c
motoreducteur.c
1
..\implementation\motoreducteur.c
+
+ remote.c
+ 1
+ ..\implementation\remote.c
+
rtc.c
1
..\implementation\rtc.c
- remote.c
+ servo.c
1
- ..\implementation\remote.c
+ ..\implementation\servo.c
@@ -457,13 +493,13 @@
Réel
0x4
ARM-ADS
- 5060960::V5.06 update 7 (build 960)::.\ARMCC
+ 5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7
0
STM32F103RB
STMicroelectronics
- Keil.STM32F1xx_DFP.2.3.0
+ Keil.STM32F1xx_DFP.2.4.0
http://www.keil.com/pack/
IRAM(0x20000000,0x00005000) IROM(0x08000000,0x00020000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE
@@ -581,11 +617,11 @@
0
1
1
- 4096
+ -1
1
BIN\UL2CM3.DLL
- "" ()
+
@@ -633,6 +669,7 @@
0
0
0
+ 0
0
0
8
@@ -845,6 +882,11 @@
4
..\driver\Lib_Com_Periph_2022.lib
+
+ adc.c
+ 1
+ ..\driver\adc.c
+
gpio.c
1
@@ -861,34 +903,64 @@
..\driver\uart.c
- adc.c
- 1
- ..\driver\adc.c
+ adc.h
+ 5
+ ..\driver\adc.h
+
+
+ gpio.h
+ 5
+ ..\driver\gpio.h
+
+
+ MyI2C.h
+ 5
+ ..\driver\MyI2C.h
+
+
+ MySPI.h
+ 5
+ ..\driver\MySPI.h
+
+
+ timer.h
+ 5
+ ..\driver\timer.h
+
+
+ uart.h
+ 5
+ ..\driver\uart.h
- MesImplementations
+ New Group
- servo.c
+ accelerometer.c
1
- ..\implementation\servo.c
+ ..\implementation\accelerometer.c
motoreducteur.c
1
..\implementation\motoreducteur.c
+
+ remote.c
+ 1
+ ..\implementation\remote.c
+
rtc.c
1
..\implementation\rtc.c
- remote.c
+ servo.c
1
- ..\implementation\remote.c
+ ..\implementation\servo.c
@@ -905,15 +977,15 @@
-
-
+
+
-
+
@@ -924,7 +996,7 @@
RTE\Device\STM32F103RB\RTE_Device.h
-
+
@@ -933,7 +1005,7 @@
RTE\Device\STM32F103RB\startup_stm32f10x_md.s
-
+
@@ -942,7 +1014,7 @@
RTE\Device\STM32F103RB\system_stm32f10x.c
-
+