AresENSEA-CDF2020
/
AresCDFMainCode_us2
Test
Diff: main.cpp
- Revision:
- 6:ea6b30c4bb01
- Parent:
- 4:ad9b7355332e
- Child:
- 10:0714feaaaee1
diff -r 34ed652f8c31 -r ea6b30c4bb01 main.cpp --- a/main.cpp Tue Jul 21 19:33:38 2020 +0000 +++ b/main.cpp Sun Jul 26 09:24:31 2020 +0000 @@ -1,14 +1,35 @@ // Nom du fichier : main.cpp #include "pins.h" +void btnFct(){ + mot_dis(); + aff_cd[0] = 0; + aff_cd[1] = 0; + + pc.printf("comptG = %d\r\n",comptG); + pc.printf("comptD = %d\r\n",comptD); + bt.printf("comptG = %d\r\n",comptG); + bt.printf("comptD = %d\r\n",comptD); +} + int main() { pc.printf("\r\nAresCDFMainCode\r\n"); bt.printf("\r\nAresCDFMainCode\r\n"); + btn.rise(&btnFct); + // debug pc.attach(&serialIT); // Interruption liaison série bt.attach(&bluetoothIT); // Interruption bluetooth + pc.baud(9600); + pc.format(8,SerialBase::None,1); + bt.baud(9600); + bt.format(8,SerialBase::None,1); + + ticker_US.attach(&captUS_trig,0.2); // On apelle cette fonction toutes 0.2 secondes + ticker_affUS.attach(&affUltrasons,1.0); + ticker_affcd.attach(&affCodeurs,1.0); // Init capteurs à ultrasons captUS_init(); @@ -30,22 +51,13 @@ // Init codeurs cdgA.rise(&cdgaRise); - //cdgB.rise(&cdgbRise); + cddA.rise(&cddaRise); cdgA.mode(PullUp); - cdgB.mode(PullUp); + cddA.mode(PullUp); + + // Odometrie - // Fonctions d'affichage pour les tests - ticker_US.attach(&captUS_trig,0.2); // On apelle cette fonction toutes 0.2 secondes - ticker_affUS.attach(&affUltrasons,1.0); - ticker_affcd.attach(&affCodeurs,1.0); - //aff_cd[0]=!aff_cd[0]; - //test_drv(); - - pc.baud(9600); - pc.format(8,SerialBase::None,1); - bt.baud(9600); - bt.format(8,SerialBase::None,1); while(1) {} }