From 6add9ea143999956b0ebda6aaf4251b1eab503ed Mon Sep 17 00:00:00 2001 From: johnse Date: Sun, 23 Nov 2025 18:20:36 +0100 Subject: [PATCH] Adding main.c --- principal.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 principal.c diff --git a/principal.c b/principal.c new file mode 100644 index 0000000..02a212a --- /dev/null +++ b/principal.c @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include + + + +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 + */ + + \ No newline at end of file