Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:f69a3351c015, committed 2020-05-04
- 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