Exemple fait en classe th4 du cours 247-637 (2017)
Dependencies: mbed
processusBouton.cpp@1:204d168becaa, 2017-09-15 (annotated)
- Committer:
- YROY2004
- Date:
- Fri Sep 15 21:12:32 2017 +0000
- Revision:
- 1:204d168becaa
- Parent:
- 0:669a6bff2494
Version publique
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YROY2004 | 0:669a6bff2494 | 1 | #include "mbed.h" |
YROY2004 | 0:669a6bff2494 | 2 | #include "processusBouton.h" |
YROY2004 | 0:669a6bff2494 | 3 | |
YROY2004 | 0:669a6bff2494 | 4 | uint16_t etatBouton; |
YROY2004 | 0:669a6bff2494 | 5 | |
YROY2004 | 0:669a6bff2494 | 6 | |
YROY2004 | 0:669a6bff2494 | 7 | DigitalIn bouton1(USER_BUTTON); |
YROY2004 | 0:669a6bff2494 | 8 | |
YROY2004 | 0:669a6bff2494 | 9 | void initialiseBouton(void) |
YROY2004 | 0:669a6bff2494 | 10 | { |
YROY2004 | 0:669a6bff2494 | 11 | etatBouton = 0; |
YROY2004 | 0:669a6bff2494 | 12 | } |
YROY2004 | 0:669a6bff2494 | 13 | |
YROY2004 | 0:669a6bff2494 | 14 | void gereBouton(void) |
YROY2004 | 0:669a6bff2494 | 15 | { |
YROY2004 | 0:669a6bff2494 | 16 | if (bouton1 == 1) |
YROY2004 | 0:669a6bff2494 | 17 | { |
YROY2004 | 0:669a6bff2494 | 18 | etatBouton = 1; |
YROY2004 | 0:669a6bff2494 | 19 | } |
YROY2004 | 0:669a6bff2494 | 20 | } |