Test

Dependencies:   mbed DRV8825

Committer:
Nanaud
Date:
Wed Jul 08 19:51:28 2020 +0000
Revision:
0:dc036b67c87c
Child:
1:2fe8c402ee79
Code principal du projet

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Nanaud 0:dc036b67c87c 1 #include "pins.h"
Nanaud 0:dc036b67c87c 2
Nanaud 0:dc036b67c87c 3 int main() {
Nanaud 0:dc036b67c87c 4 pc.printf("\r\nAresCDFMainCode\r\n");
Nanaud 0:dc036b67c87c 5 pc.attach(&serialIT); // On met une interruption sur la liaison série avec le PC. Cette interruption lance la fonction serialIT.
Nanaud 0:dc036b67c87c 6 AresUltrasonsInit();
Nanaud 0:dc036b67c87c 7 ticker_US.attach(&AresUltrasons,0.2); // On apelle cette fonction toutes 0.2 secondes
Nanaud 0:dc036b67c87c 8 ticker_affUS.attach(&affUltrasons,1.0); // On apelle cette fonction toutes les secondes
Nanaud 0:dc036b67c87c 9 echo1.rise(&echoRise1);
Nanaud 0:dc036b67c87c 10 echo1.fall(&echoFall1);
Nanaud 0:dc036b67c87c 11 echo2.rise(&echoRise2);
Nanaud 0:dc036b67c87c 12 echo2.fall(&echoFall2);
Nanaud 0:dc036b67c87c 13 echo3.rise(&echoRise3);
Nanaud 0:dc036b67c87c 14 echo3.fall(&echoFall3);
Nanaud 0:dc036b67c87c 15 echo4.rise(&echoRise4);
Nanaud 0:dc036b67c87c 16 echo4.fall(&echoFall4);
Nanaud 0:dc036b67c87c 17 echo5.rise(&echoRise5);
Nanaud 0:dc036b67c87c 18 echo5.fall(&echoFall5);
Nanaud 0:dc036b67c87c 19 echo6.rise(&echoRise6);
Nanaud 0:dc036b67c87c 20 echo6.fall(&echoFall6);
Nanaud 0:dc036b67c87c 21
Nanaud 0:dc036b67c87c 22 drv_init();
Nanaud 0:dc036b67c87c 23
Nanaud 0:dc036b67c87c 24 ticker_affcd.attach(&affCodeurs,1.0); // On apelle cette fonction toutes les secondes
Nanaud 0:dc036b67c87c 25 cdgA.rise(&cdgaRise);
Nanaud 0:dc036b67c87c 26 cdgB.rise(&cdgbRise);
Nanaud 0:dc036b67c87c 27 cdgA.mode(PullUp);
Nanaud 0:dc036b67c87c 28 cdgB.mode(PullUp);
Nanaud 0:dc036b67c87c 29
Nanaud 0:dc036b67c87c 30 aff_cd[0]=!aff_cd[0];
Nanaud 0:dc036b67c87c 31 aff_cd[1]=!aff_cd[1];
Nanaud 0:dc036b67c87c 32
Nanaud 0:dc036b67c87c 33 while(1) {
Nanaud 0:dc036b67c87c 34
Nanaud 0:dc036b67c87c 35 }
Nanaud 0:dc036b67c87c 36 }