premiere ebauche

Dependencies:   mbed PinDetect

Committer:
shovelcat
Date:
Thu Oct 18 17:31:03 2018 +0000
Revision:
3:4da392d2bae8
Parent:
2:06f128641b62
Child:
4:a8c9f6a13633
version avec Objet. version sans eco-conduite (eco disabled) fonctionne sur le vehicule. Reste a valider la fonction de transfert et fonctionner sur le vehicule.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shovelcat 0:011f69c1276c 1 #include "mbed.h"
shovelcat 2:06f128641b62 2 #include "speedlimiter.hpp"
shovelcat 0:011f69c1276c 3
shovelcat 3:4da392d2bae8 4 /*
shovelcat 0:011f69c1276c 5 ##############################
shovelcat 1:c6b4ccebd483 6 uC I/O
shovelcat 1:c6b4ccebd483 7 ##############################
shovelcat 3:4da392d2bae8 8 */
shovelcat 0:011f69c1276c 9
shovelcat 3:4da392d2bae8 10 //InterruptIn b1(PC_13);
shovelcat 3:4da392d2bae8 11 DigitalOut led1(LED1);
shovelcat 3:4da392d2bae8 12 DigitalOut led2(LED2);
shovelcat 3:4da392d2bae8 13 DigitalOut led3(LED3);
shovelcat 0:011f69c1276c 14
shovelcat 3:4da392d2bae8 15 /*
shovelcat 0:011f69c1276c 16
shovelcat 3:4da392d2bae8 17 */
shovelcat 0:011f69c1276c 18
shovelcat 3:4da392d2bae8 19 int main()
shovelcat 3:4da392d2bae8 20 {
shovelcat 3:4da392d2bae8 21 const PinName pedalInHi = PA_3; // A0
shovelcat 3:4da392d2bae8 22 const PinName pedalInLo = PC_0; // A1
shovelcat 3:4da392d2bae8 23 const PinName pedalOutHi = PA_4; // D9 (left)
shovelcat 3:4da392d2bae8 24 const PinName pedalOutLo = PA_5; // D13 (right)
shovelcat 3:4da392d2bae8 25 SpeedLimiter speedLimiter(pedalInHi, pedalInLo, pedalOutHi, pedalOutLo);
shovelcat 3:4da392d2bae8 26 speedLimiter.start();
shovelcat 0:011f69c1276c 27
shovelcat 3:4da392d2bae8 28 while(1) {
shovelcat 3:4da392d2bae8 29 led1 = true;
shovelcat 3:4da392d2bae8 30 wait(1.0);
shovelcat 3:4da392d2bae8 31 led1 = false;
shovelcat 3:4da392d2bae8 32 led2 = true;
shovelcat 3:4da392d2bae8 33 wait(1.0);
shovelcat 3:4da392d2bae8 34 led2 = false;
shovelcat 3:4da392d2bae8 35 led3 = true;
shovelcat 3:4da392d2bae8 36 wait(1.0);
shovelcat 3:4da392d2bae8 37 led3 = false;
shovelcat 1:c6b4ccebd483 38 }
shovelcat 1:c6b4ccebd483 39 }
shovelcat 1:c6b4ccebd483 40