TRR2018 omar

Dependencies:   mbed

Fork of biniou by TRR 2018

Committer:
ohlimi2
Date:
Wed Sep 19 11:05:05 2018 +0000
Revision:
37:810cdbcbbf3f
Parent:
36:bccddd02966a
Child:
39:de3638276b7e
ajout du coef de la vitesse

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GaspardD 8:1d8c3ca5e508 1 #include "stateMachines.h"
GaspardD 33:88d8f254c0b7 2
GaspardD 23:04d393220daa 3 Timer timerLoop;
GaspardD 29:fc984fe08ca7 4 #if DEBUG >= -1
GaspardD 29:fc984fe08ca7 5 InterruptIn dump_button(USER_BUTTON);
GaspardD 29:fc984fe08ca7 6 #endif
GaspardD 29:fc984fe08ca7 7
ohlimi2 1:abed67ad1d03 8 int main()
ohlimi2 1:abed67ad1d03 9 {
GaspardD 29:fc984fe08ca7 10 #if DEBUG >= -1
GaspardD 29:fc984fe08ca7 11 dump_button.fall(&pressed);
GaspardD 29:fc984fe08ca7 12 initSamples();
GaspardD 29:fc984fe08ca7 13 #endif
GaspardD 29:fc984fe08ca7 14 initIntegrationTable();
GaspardD 23:04d393220daa 15 mursInit();
GaspardD 11:bc24b3ba51a9 16 #ifdef DLVV
GaspardD 23:04d393220daa 17 obstacleInit();
GaspardD 23:04d393220daa 18 #endif
GaspardD 23:04d393220daa 19 sectionInit();
GaspardD 23:04d393220daa 20 maxSpeedInit();
GaspardD 23:04d393220daa 21 throttleInit();
GaspardD 23:04d393220daa 22 timerLoop.start();
GaspardD 23:04d393220daa 23 while (1) {
ohlimi2 36:bccddd02966a 24 //wait(0.4);
ohlimi2 37:810cdbcbbf3f 25 if(timerLoop.read_us()>20000) { // output every 20 ms
GaspardD 23:04d393220daa 26 timerLoop.reset();
GaspardD 23:04d393220daa 27 timerLoop.start();
GaspardD 23:04d393220daa 28 mursUpdate();
GaspardD 23:04d393220daa 29 #ifdef DLVV
GaspardD 23:04d393220daa 30 obstacleUpdate();
GaspardD 23:04d393220daa 31 #endif
GaspardD 27:f8c3f1524a64 32
GaspardD 27:f8c3f1524a64 33 sectionUpdate();
GaspardD 27:f8c3f1524a64 34 maxSpeedUpdate();
GaspardD 27:f8c3f1524a64 35 throttleUpdate();
GaspardD 11:bc24b3ba51a9 36
ohlimi2 1:abed67ad1d03 37
GaspardD 27:f8c3f1524a64 38 mursOutput();
GaspardD 23:04d393220daa 39 #ifdef DLVV
GaspardD 27:f8c3f1524a64 40 obstacleOutput();
GaspardD 23:04d393220daa 41 #endif
GaspardD 27:f8c3f1524a64 42 sectionOutput();
GaspardD 27:f8c3f1524a64 43 maxSpeedOutput();
GaspardD 27:f8c3f1524a64 44 throttleOutput();
GaspardD 27:f8c3f1524a64 45 }
GaspardD 23:04d393220daa 46 #ifdef SAMPLING
GaspardD 27:f8c3f1524a64 47 sampleLog();
GaspardD 23:04d393220daa 48 #endif
GaspardD 23:04d393220daa 49
ohlimi2 1:abed67ad1d03 50 }
GaspardD 29:fc984fe08ca7 51 }