Gyro globallement fonctionnel, mais la précision laisse à désirer

This commit is contained in:
Samuel 2022-09-26 21:54:06 +02:00
parent 317180158e
commit d7fbf056cf
2 changed files with 25 additions and 0 deletions

20
Temps.c Normal file
View File

@ -0,0 +1,20 @@
#include <stdio.h>
#include "pico/stdlib.h"
#include "Temps.h"
uint32_t temps_ms=0;
struct repeating_timer timer;
bool Temps_increment(struct repeating_timer *t){
temps_ms++;
return true;
}
void Temps_init(void){
temps_ms=0;
add_repeating_timer_ms(-1, Temps_increment, NULL, &timer);
}
uint32_t Temps_get_temps_ms(void){
return temps_ms;
}

5
Temps.h Normal file
View File

@ -0,0 +1,5 @@
#include "pico/stdlib.h"
bool Temps_increment(struct repeating_timer *t);
void Temps_init(void);
uint32_t Temps_get_temps_ms(void);