Skip to content

Commit

Permalink
Création de signal.h et mise à jour de position.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ianparizot committed Nov 25, 2024
1 parent 9aa376c commit fa639cf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 5 additions & 2 deletions WRO2025/WRO2025_functions/position.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#ifndef POSITION_H
#define POSITION_H
#include <time.h>
#include "signal.h"

int a;

double time_to_collision_at_rest(float velocity) {
clock_t start = clock();
do {
velocity++;
} while (velocity < 1000000);
a = signal();
} while (a == 1);
clock_t end = clock();
double time_to_reception = ((double)(end-start)) / CLOCKS_PER_SEC;
return time_to_reception;
Expand Down
16 changes: 16 additions & 0 deletions WRO2025/WRO2025_functions/signal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef SIGNAL_H
#define SIGNAL_H

inline int signal() {
int trueornot;
if (trueornot == 0)
{
return 0;
}
else {
return 1;
}

}

#endif SIGNAL_H

0 comments on commit fa639cf

Please sign in to comment.