Galloy_rascol Damien / Mbed 2 deprecated 4-kbi

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dg81
Date:
Mon May 04 14:05:41 2020 +0000
Commit message:
kbi

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 04 14:05:41 2020 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX,19200); // tx, rx sur les broches associées au bus USB
+InterruptIn myBP1(PTC6); // la broche PTC6 génère une interruption à chaque changement d'état
+InterruptIn myBP2(SW3); // la broche PTC6 génère une interruption à chaque changement d'état
+  int i=0; // i est une variable globale
+
+void Interruption_KBI1()
+{
+    i++;
+    printf("La valeur de i est : %d \n",i);
+} 
+
+void Interruption_KBI2()
+{
+    i++;
+    printf("La valeur de i est : %d \n",i);
+} 
+
+int main(void)
+{
+    myBP1.rise(&Interruption_KBI1); // attche l'adresse du programme d'interruption à un front montant de SW2
+    myBP2.rise(&Interruption_KBI2); // attche l'adresse du programme d'interruption à un front montant de SW2
+    while(1)
+    {
+    }
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 04 14:05:41 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file