carte esclave Petit Robot

Dependencies:   mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr

Revision:
10:48c0d1b8aed9
Parent:
9:9833e788942b
Child:
25:9627700d989f
--- a/Capteurs/dt.cpp	Fri May 17 10:39:09 2019 +0000
+++ b/Capteurs/dt.cpp	Sat May 18 12:07:01 2019 +0000
@@ -7,10 +7,10 @@
 AnalogIn DT3(PC_4);
 AnalogIn DT4(PA_5);
 
-DigitalIn DT1_isr(PB_1);
-DigitalIn DT2_isr(PA_7);
-DigitalIn DT3_isr(PA_6);
-DigitalIn DT4_isr(PA_4);
+InterruptIn DT1_isr(PB_1);
+InterruptIn DT2_isr(PA_7);
+InterruptIn DT3_isr(PA_6);
+InterruptIn DT4_isr(PA_4);
 
 Timer t;
 
@@ -30,6 +30,11 @@
 double DT4_trait[256]= {0};
 double DT4_trait_Ex;
 
+bool DT1_interrupt_Ex;
+bool DT2_interrupt_Ex;
+bool DT3_interrupt_Ex;
+bool DT4_interrupt_Ex;
+
 unsigned char n = 0;
 bool flag_t=0;
 
@@ -92,3 +97,13 @@
         }
     }
 }
+
+void interrupt()
+{
+    DT1_interrupt_Ex = DT1_isr.read();
+    DT2_interrupt_Ex = DT2_isr.read();
+    DT3_interrupt_Ex = DT3_isr.read();
+    DT4_interrupt_Ex = DT4_isr.read();
+}
+
+