Adding main.c
This commit is contained in:
parent
f7f7c1b987
commit
6add9ea143
1 changed files with 53 additions and 0 deletions
53
principal.c
Normal file
53
principal.c
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#include <stm32f10x.h>
|
||||
#include <Horloge.h>
|
||||
#include <MYGPIO.h>
|
||||
#include <MySPI.h>
|
||||
#include <Accelerometre.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
uint16_t * Melding;
|
||||
volatile uint16_t X;
|
||||
volatile uint16_t Y;
|
||||
volatile uint16_t Z;
|
||||
|
||||
int main ( void )
|
||||
{
|
||||
//RCC->APB2ENR |= RCC_APB2ENR_IOPBEN; //Broder!!! Hvorfor var ikke den linjen kode her! Var Brage btw som fjernet den. Ingenting skjer hvis selve clocken ikke er på!
|
||||
initAccelo();
|
||||
initLacheur();
|
||||
while(1){
|
||||
Melding = KattRecupAccelo();
|
||||
LacheVoile(Melding);
|
||||
//Juste pour essayer de regarder ce que ça affiche
|
||||
X=Melding[0];
|
||||
Y=Melding[1];
|
||||
Z=Melding[2];
|
||||
}
|
||||
while(1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
RCC->APB2ENR |= (0x01 << 2) | (0x01 << 3) | (0x01 << 4) ;
|
||||
Timer_Init(TIM1, ARR_VAL, PSC_VAL);
|
||||
|
||||
//Test du PWM
|
||||
//PORTA & 0x00000400)>>10
|
||||
MyTimer_PWM(TIM1, 3);
|
||||
Set_DutyCycle_PWM(TIM1, 3, 10);
|
||||
*/
|
||||
/*
|
||||
//DEL INTERNE
|
||||
#if INTERNE
|
||||
initGPIO_Interne();
|
||||
MyTimer_ActiveIT(TIM3, 2, commuterDEL_Interne);
|
||||
#else
|
||||
//DEL EXTERNE BRANCHE SUR PB8 et GND (D14 & D8 AVEC LA TEXTE BLEUE SUR LA CARTE)
|
||||
initGPIO_Externe();
|
||||
MyTimer_ActiveIT(TIM2, 2, commuterDEL_Externe);
|
||||
#endif
|
||||
*/
|
||||
|
||||
|
||||
Loading…
Reference in a new issue